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

Community Forums 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 contains 1 reply, has 2 voices, and was last updated by  braddalton 8 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #88195

    billmcq
    Participant
    Post count: 29

    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!!!

    #88357

    braddalton
    Participant
    Post count: 10217

    Add this to your archive-cpt.php file for HTML 5 themes.
    [php]
    //* Remove the post info function
    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 5 );
    [/php]
    And this if running XHTML
    [php]
    //* Remove the post info function
    remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
    [/php]

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


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.