WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
Proper condition code for single-speakers.php (2 posts)

  1. Faramarz
    Member
    Posted 1 year ago #

    Hi,

    I have a 'Speakers' custom post type that uses single-speakers.php instead of the default single.php. I want to display a specific sidebar on my single-speakers.php (with Widget Logic) when single speakers/posts are displayed. What is the proper conditional code for my single-speakers.php posts?

    Thanks

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

  2. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    single-speakers.php could specify a named sidebar (if it's been declared in your theme already) and you could just configure that sidebar.

    alternatively is_singular( 'single-speakers' ) is the form of conditional tag used to match custom post types, according to…

    http://codex.wordpress.org/Conditional_Tags#A_Single_Page.2C_Single_Post_or_Attachment

    though I've not had the opportunity to try it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic