• 0
Sign in to follow this  
Followers 0

How To Display Title on Category Page

Question

Posted · Report post

How do I get the Category Name to display as a title on a category page? ex/ to have Books by TLC show as h1 title on http://teralynn.com/books/ I've found a code suggestion: <?php if ( is_category() ) { ?>

<?php single_cat_title(''); ?>

<?php } ?> But I'm more comfortable with HTML and CSS than PHP and I'm not sure where to place the code. Is there an easier way to do that? If not, in what file do I place the code and where? Thank you! Tera

Share this post


Link to post
Share on other sites

8 answers to this question

  • 0

Posted · Report post

Place it inside "functions.php". It is located in "Platforbase" folder. (I assume you have activated "Platforbase" not "PlatformPro" since that is the way you customize your theme.)

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thank you! But when I tried to paste that line of code into the "functions.php" file my site won't display and I get a php error. Is there something wrong with the code? Or somewhere specific I should place it in the file?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Most probably you have it on the wrong place or missed a letter or part of the code. Remove The code you placed thereand reload your site to make sure it works. Then try to find a line in "functions.php" that says "// ADDING NEW TEMPLATES //". Place the following lines of codes right before that: /* Adding new category titles. The default category title is hidden using CSS (.current_posts_info). */ add_action('pagelines_inside_top_theloop','cat_title'); function cat_title(){?> <?php if (is_category()): ? >

<?php echo single_cat_title(); ?>

<?php endif; }

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Okay, I did that. But I then I get this error when I load my page: Parse error: syntax error, unexpected '?' in /hermes/web11/b1138/moo.creativeblipcom/teralynn/wp-content/themes/platformbase/functions.php on line 92 Thank you AGAIN!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hello,

I found the place to paste the code, but I get an error too. Is the code right?

 

/* Adding new category titles. The default category title is hidden using CSS (.current_posts_info). */ add_action('pagelines_inside_top_theloop','cat_title'); function cat_title(){?>

title(); ?>

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hello xcel7

 

Please could you create a new topic with all the information and we will take a look for you. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Did this ever get resolved? I need help with this too.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

This topic is over two years old and the solution provided above, will most likely not work for PageLines Framework or DMS. Therefore, can you please create a new topic.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0