• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Help with conditonal for 2 Custom post types including archive and single posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help with conditonal for 2 Custom post types including archive and single posts

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 12 years, 9 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 2, 2014 at 11:43 am #88195
    Bill
    Participant

    I hope someone can shed some light on this. I need to remove the genesis post info for two different custom post types. I figured out how to do it for the single posts, but I want it to also remove the date on these post type archive pages as well.

    When I try to add more conditional logic to it so it also removed from the CPT archive pages as well, it breaks. I was on wordpress and a bunch of other sites to figure out the right code for removing 2 post types on both single and archive pages...but cant get it. This is what I have that works for the two single post custom post types (not including the archive pages as well). that is the part I would like to add into this.

    /* Customize the entry meta in the entry header*/
    add_filter( 'genesis_post_info', 'my_post_info_filter' );
    function my_post_info_filter1( $post_info ) {
    if ( is_singular( array( 'cpt1', 'cpt2' ) ) ) {
    $post_info = '';
    }

    return $post_info;

    }

    any help is greatly appreciated!!!

    February 3, 2014 at 11:08 am #88357
    Brad Dalton
    Participant

    Add this to your archive-cpt.php file for HTML 5 themes.

    //* Remove the post info function
    remove_action( 'genesis_entry_header', 'genesis_post_info', 5 );
    

    And this if running XHTML

    //* Remove the post info function
    remove_action( 'genesis_before_post_content', 'genesis_post_info' );
    

    Can also use either of these for your single-cpt.php files rather than functions file code.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble