WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Conditional tags for Custom Post Types (3 posts)

  1. bluebird2
    Member
    Posted 3 years ago #

    I need to show certain widgets on some of the Custom post types and hide them on some others. What conditional tags I can use for Custom Post Types?

    get_post_type() 
    
    post_type_exists() 
    
    is_post_type_hierarchical($post_type) 
    
    is_post_type_hierarchical('book')

    I have used these ones but it seems none of them work. Are these the right conditional tags?

    http://wordpress.org/extend/plugins/widget-logic/

  2. thecorkboard
    Member
    Posted 3 years ago #

    Bump :)

  3. alanft
    Member
    Plugin Author

    Posted 3 years ago #

    http://codex.wordpress.org/Conditional_Tags#A_Post_Type

    implies that things like

    get_post_type() == 'book'

    should work fine

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic