Jump to content

Archived

This topic is now archived and is closed to further replies.

solosails

Titles not showing in Category and tag pages

Recommended Posts

solosails    1
solosails

Ah, Actually I haven't solved it!

 

The above works for single categories, however, I still can't get it to work for the blog page that lists all categories.

 

If I use get_title or a range of others, it just returns the title of the 1st listed blog.

 

Any idea anyone how to get the page title for the blog page?

Share this post


Link to post
Share on other sites
greenfly    230
greenfly

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. 


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
solosails    1
solosails

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
greenfly    230
greenfly

use the page id as .blog 

 

have you tried this? 


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
solosails    1
solosails

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

Share this post


Link to post
Share on other sites
greenfly    230
greenfly

Sorry - my bad - i meant .news 

 

Could you try this? 


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
solosails    1
solosails
No, that didn't work either..?

Share this post


Link to post
Share on other sites
solosails    1
solosails

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
solosails    1
solosails

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
solosails    1
solosails

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
greenfly    230
greenfly

@solosails 

 

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


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

×