• 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 post_content from a CPT in Genesis Framework

Learn in this tutorial how to hide the post_content or content in a Custom Post Type (CPT) in Genesis Framework by code.

If you are using a CPT that only uses custom fields to fill in and display the CPT information, you don’t need the default content (post_content) to be loaded.

Do you want to remove it?

You can do this easily with a Genesis hook (specifically, genesis_entry_content) and WordPress conditional tags.

Here we go.

Snippet to remove CPT content in Genesis

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

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

There you go.

With the previous code, the content will no longer be displayed in the CPT portfolio entries, but I invite you to modify it to the one you want.

Conclusions

Now you know how to erase the post_content of a CPT in any Genesis child theme.

Any questions? I read you 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. 😉

CPT Genesis Framework PHP

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?