Site logo

Archived topic

Filter hook for {{post_title}}

10 replies · Started by Ash on April 8, 2021

Viewing posts 1–11 of 11

Is there a filter hook for {{post_title}} in the Header Element?

Hi there,

Not sure if I understand.

That is just a template tag that outputs the post title in the header element.

What are you hoping to achieve?

I'd like to modify the output conditionally on a CPT archive/taxonomies.

Default page title won't be hidden with the shortcode.
Is there a setting to hide the default page title?

Is there an argument of generate_show_title to pass through the default value?

Also somehow Disable Elements on the Layout Element is not working.
Content Title doesn't work on post/cpt archives. Other options such as Top bar works.

Neither Layout Element nor generate_show_title works, because it seems that they are not applied for the archive title.
I found that generate_archive_title is needed to modify the archive title.
Just FYI.

add_action('wp',function(){
if(is_post_type_archive('cpt-1')){
remove_action('generate_archive_title','generate_archive_title');
}
},20);

Sorry my bad - i skimmed the topic and only saw the Post - not the archives.... glad yo found the solution

This archived topic is closed to new replies.