• 0

Titles not showing in Category and tag pages

Question

Posted · Report post

Hi everyone,

 

On my categories and tags pages/archives the page title fails to show, yet shows everywhere else. Any ideas anyone?

 

www.solosails.com/news/

 

Thanks, Andrew

Share this post


Link to post
Share on other sites

35 answers to this question

  • 0

Posted · Report post

Is this the static blog page and not the single post page? 

 

You can add some page specific CSS if this is the case to hide the hook on the blog page and use a specific hook with specific content on the blog page only. 

 

Let me work this through for you and i will update you. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, Yep, the static Blog page as set in Wordpress.

 

I cant see any hooks that are different in that page though.

 

I can get things in there using a general hook, but I cant get it to work using the the page id, it's as if the page id gets ignored

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

use the page id as .blog 

 

have you tried this? 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

No,, nor does just blog, or the id number of that page 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Sorry - my bad - i meant .news 

 

Could you try this? 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

No, that didn't work either..?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

I managed to get the blog page title working by adding a content box to 'blog' template then hard coding the title.

 

Not ideal, but it works.

 

If I decide to change the name or the description of the blog page at some point, it isn't going to be automated, which is a pity, but there you go!

 

If you do find a way to get a hook working for the blog page, that would be great!

 

Thanks for your help

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hmm, I need to rethink this.

 

Unfortunately, if I use the ?php single_cat_title(); ?> It also adds this extra title to tag pages as well as product category pages...?

 

Does pagelines group all category's and tags into one call? if so, how would I separate tags from categories?

 

  

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

OK,

 

I think this time I have all bases covered!

 

<?php /* If this is a category archive */ if (is_category()) { ?>
<h1><?php single_cat_title(); ?></h1><h2><em><span style="color: #b8b8b8; font-size: 15px;"><?php echo category_description(); ?></span></em></h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h1><?php single_tag_title(); ?></h1><h2><em><span style="color: #b8b8b8; font-size: 15px;"><?php echo category_description(); ?></span></em></h2>
<?php } ?>
 
This placed before the loop, will give the category pages a title and description as well as the tags, but it will not effect product archives or (as was the case for me) xml pages

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@solosails 

 

Very nice. Thank you for the very detailed updates and for the fix which will help others in future. 

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