Archived topic
Show / Hide titles ( or elements) in Custom Post
2 replies · Started by Jorge on July 7, 2017
Hello
This is my first query about GP after the purchase.
Is there a default way for the template to hide the titles?
This should happen for custom post created by me (with Toolset's TYPES).
I work with TOOLSET where I create a LAYOUT and use as a PARENT to the same Theme GP
This Layout shows a single post where, when editing, is the option to show / hide the title.
But I must do it post by post and there are many
Sorry if the answer is very obvious, I'm just getting to know GP
Thank you very much - Jorge
Hi there,
Are you referring to the disable eleemnt meta box?
https://docs.generatepress.com/article/disable-elements-overview/
Or an option within ToolSet?
Are you able to link me to the page?
You can remove the title when within a CPT with a function:
add_action( 'wp', 'tu_disable_cpt_elements' );
function tu_disable_cpt_elements() {
if ( 'product' == get_post_type() ) {
add_filter( 'generate_show_title', '__return_false' );
}
}
product being the custom post type name.