• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Remove the top metadata from a Custom Post Type in Genesis

Find out how to hide the metadata that appears at the beginning of a Custom Post Type (CPT) in Genesis Framework by code.

When you do not need to display the date, author and number of comments under the title of a CPT in a Genesis child theme, you can easily hide them with the following snippet:

Code to suppress the metadata at the beginning of a CPT

Add this fragment at the end of the functions.php file:

To see this and another 847 code snippets of this website, login or subscribe here.

It’s as simple as that.

In this case, the metadata from Custom Post Type called “portfolio” will be removed. Change that text to the CPT you are interested in (“products”, “events“… ).

If the CPT has its own template (for example: single-portfolio.php), another option is that you insert the following code in it, just before genesis();

To see this and another 847 code snippets of this website, login or subscribe here.

Conclusions

Now you know how to remove the metadata that appears under the header and title of a CPT in Genesis child themes.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits of being a subscriber. 🙂

CPT Genesis Framework PHP Post meta

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?