Find out how to remove the title of a Custom Post Type (CPT) in Genesis Framework with a simple code snippet.
If you don’t want to display the title in one or more entries of a CPT, you can use a Genesis hook in combination with WordPress conditional tags.
Here’s how to do it:
Snippet to remove the title of a CPT in Genesis
Add the following fragment at the end of functions.php file:
To see this and another 1097 code snippets of this website, login or subscribe here.
With this second fragment you limit the conditional, instructing it to only delete the title in portfolio entries with IDs 11, 55 and 73. Of course, you can modify these values as you prefer.
Using WordPress conditional tags you can get this code to affect other post types, for example:
If you wish, you can also remove the main title of the website.
Conclusion
As you can see, with a single line of code you can remove all CPT titles from your Genesis child theme.
Also, if you use WordPress conditionals you can limit it so that it only deletes the titles from the entries you’re interested in.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉