Jump to content
Sign in to follow this  
terachilds

How To Display Title on Category Page

Recommended Posts

terachilds

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
Sourena

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.)


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
terachilds

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
Sourena

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; }

alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
terachilds

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
xcel7

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
greenfly

Hello xcel7

 

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


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
KristaD

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

Share this post


Link to post
Share on other sites
Danny

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.


Please search our forums, before posting!

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  

×