Hi Air,
Long time.
I have a page that shows my posts (posts page) and I have two other pages that show specific category posts. The posts that show on the latter do not appear on the former (by tweaking the code). Everything is fine, except when I click on a specific post on the category posts page: the title shows the default posts page title instead of the category page title.
To illustrate:
Page AAA (BLOG on the demo)
Post
#1Post
#2Page BBB (CATEGORY ARCHIVES: POST on the demo)
Post
#3Post
#4Page CCC (another CATEGORY ARCHIVES: POST)
Post
#5Post
#6When I go to Post
#1, the title shows 'AAA' (BLOG on the demo), which is fine. However, when I go to Post
#3 and Post
#5, the page (header?) title also shows 'AAA' instead of 'BBB' and 'CCC', respectively. Would it be possible to change this?
I hope I was able to articulate my question well.
Thank you in advance for your help,
LazyDiver
Comments
It is not so easy, cause:
1) This posts are still part of the blog.
2) Each post can have many categories.
this means you will have to write specific code to detect that post is in your special category and then display different title then 'Blog'.
With regards.
I think it's this part of utilities.php that I need to revise in order to achieve what I want: But how do I change it exactly? Could you please help me? I tried to do it myself, but to no avail.
Let's say I have a category called XXX (ID=11), the title of which I would like to show instead of $blog_h1.
Many thanks in advance,
LazyDiver
$blog_h1 = get_the_title(get_option('page_for_posts'));
Try changing its value to see different results. Now you have to something like: Hope that helps.With regards.
Just a follow-up question: Do I have to replace the file in the parent theme and do this every time I update? I tried saving a modified utilities.php in the child folder, but the changes did not take effect.
Regards,
LazyDiver
With regards.