Title: Proper condition code for single-speakers.php
Last modified: August 21, 2016

---

# Proper condition code for single-speakers.php

 *  [Faramarz](https://wordpress.org/support/users/faramarz/)
 * (@faramarz)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/proper-condition-code-for-single-speakersphp/)
 * 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/](http://wordpress.org/plugins/widget-logic/)

Viewing 1 replies (of 1 total)

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/proper-condition-code-for-single-speakersphp/#post-4022087)
 * 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](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.

Viewing 1 replies (of 1 total)

The topic ‘Proper condition code for single-speakers.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 1 reply
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/proper-condition-code-for-single-speakersphp/#post-4022087)
 * Status: not resolved