Archived topic
Archive post titles gone after upgrade
3 replies · Started by Craig on October 29, 2020
Hello,
A recent GP upgrade affected how my Archive pages work.
New archive (post titles missing) - https://school.stjosephwaconia.org/document-category/saints-news/
Old archive (post titles working) - http://spmsjwasc.staging.wpengine.com/document-category/saints-news/
I use the following snippet to hide post titles...and it had been working great for about 3 years...it never affected the archive pages...
add_action( 'after_setup_theme', 'tu_remove_all_titles' );
function tu_remove_all_titles() {
add_filter( 'generate_show_title', '__return_false' );
}
Is there a conditional way for this code to not affect archive pages? I think my problem would be solved.
FWIW - I use a number of Beaver Builder layouts to display the titles...that's why I was using the snippet above in the first place.
Thanks!
Craig
Hi there,
Yes, that filter now applies to archives as well.
You should be able to tweak it like this:
add_action( 'wp', function() {
if ( is_singular() ) {
add_filter( 'generate_show_title', '__return_false' );
}
} );
Let me know :)
Thanks Tom! Worked perfectly!
Glad I could help! :)