Archived topic
Post titles missing on archive and category pages
7 replies · Started by Craig on March 31, 2021
Hi folks,
Not sure when this happened, but must have been a recent upgrade.
The post titles are missing on the archive and category pages.
Here's an example: https://bankbeat.biz/category/chronicles/
Currently using:
GP Child Theme & GP 3.0.3
GP Premium 1.12.3
POSSIBLY RELATED: I do use the GP Hooks and Page Headers features, but those appear to be deprecated now. Not sure if that is what is causing my issue here, but do you have some published guidance on working through the new changes? I must've missed it.
Thanks!
Hi Craig,
Do you have a layout element that's removing the content title?
https://docs.generatepress.com/article/layout-element-overview/
Let me know :)
Hi Leo,
I haven't enabled or begun using the Elements features of GP.
I'm beginning to think that is part of my issue though...I'm still using Page Headers and Hooks. I haven't migrated to Elements.
I created a staging site and when de-activated/re-activated GP Premium, it took away Hooks & Page Headers...but the Archive/Category post titles returned: http://spmnfr.staging.wpengine.com/category/chronicles/
Since I have about 8 page headers, it's going to take me some time to recreate those any my hooks with Elements.
Any suggestion on bringing back post titles on the archive/category pages until I can schedule time to migrate Hooks & Page Headers?
Thanks!
Craig
Which version did you update from?
Are you able to isolate whether the issue is coming from GP hooks or Page header?
Thanks :)
OK...getting closer here...
Sorry, I don't recall which version I updated from when this occurred, but it's definitely related to the Page Header feature.
On my staging site, when I deactivate Page Header, I get a pop-up saying, "This module has been deprecated. Deactivating it will remove it from this list."
After deactivation, post titles re-appear. That's great, but my 8 other page headers are gone too.
Thanks for any suggestions,
Craig
Hi there,
This is due to GP 3.0.0 allowing post titles to be removed on archives. Your Page Headers are telling the page to remove post titles, but it's applying to each post as well (instead of just the archive title).
We prevent this in Elements, but since Page Headers are deprecated, it's not prevented there.
To prevent it yourself, try this:
add_action( 'wp', function() {
if ( ! is_singular() ) {
add_filter( 'generate_show_title', '__return_true', 20 );
}
} );
Let me know if that helps or not :)
Tom,
Thank you! Your solution worked perfectly.
I'm in the process right now of migrating my Page Headers to Elements right now, so this buys me some time.
Wow...Elements are pretty cool! Finally making time to learn these features.
Thank you again for your continuous improvement to GP!
Craig
Great to hear. Glad you like it! :)