Title: [Plugin: Meteor Slides] Conditional statement
Last modified: August 19, 2016

---

# [Plugin: Meteor Slides] Conditional statement

 *  Resolved [simonbugler](https://wordpress.org/support/users/simonbugler/)
 * (@simonbugler)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/)
 * Is it possible to create a conditional statement that will display a default 
   slideshow if none is selected.
 * Currently I’m auto filling the category slug like so:
 *     ```
       <?php
       			if (is_category( )) {
       			$cat = get_query_var('cat');
       			$yourcat = get_category ($cat);
       			}
       			?>
   
       			<?php if(function_exists('meteor_slideshow')) { meteor_slideshow(".$yourcat->slug .", ""); } ?>
       ```
   
 * [http://wordpress.org/extend/plugins/meteor-slides/](http://wordpress.org/extend/plugins/meteor-slides/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * (@jleuze)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/#post-1767034)
 * Hi Simon, this should be doable but I’m not sure I understand exactly how you
   have this setup.
 * So you are using this code on your blog category pages and loading the blog category
   as the slideshow option so that you can load a slideshow that has been setup 
   for that category?
 * But categories and slideshows are both taxonomies, so you couldn’t use the same
   names in each and match them up, is there something I’m missing here?
 *  Thread Starter [simonbugler](https://wordpress.org/support/users/simonbugler/)
 * (@simonbugler)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/#post-1767038)
 * > So you are using this code on your blog category pages and loading the blog
   > category as the slideshow option so that you can load a slideshow that has 
   > been setup for that category?
 * This is exactly what I’m doing – and it works very well!!??
 * The only problem is if a slideshow doesn’t exist. Currently I have a background
   image that shows – but wondered what the code would be to select a default slideshow
   for when one doesn’t exist
 *  Thread Starter [simonbugler](https://wordpress.org/support/users/simonbugler/)
 * (@simonbugler)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/#post-1767044)
 * Ok – this only works if I use the add category field on the post/slide page..!
 * Is this a bug in WordPress – am I going to have problems for having duplicate
   category/slug names??
 * Is there a better way to insert slide shows on category pages?
 *  Plugin Author [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * (@jleuze)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/#post-1767051)
 * It’s not a bug per se. The categories, tags, and custom taxonomies like slideshows
   are all considered “terms” by WordPress. Each term has to have a unique slug,
   like if you create category called Test and then a tag called Test, the category
   will have the slug “test” and the tag will have the slug “test-2”.
 * So right now you have one template file, category.php, that you have this conditional
   statement in to dynamically load the correct slideshow?
 * I don’t know how many categories/slideshows you have, but you could create some
   custom category templates and add the corresponding slideshow to each template.
   Then you could add a default slideshow to the category.php file for categories
   that don’t have a slideshow.
 * If you have a ton of categories and need this to be more dynamic, I’d design 
   your statement to work with a certain naming structure. Like if you have a News
   category, create a slideshow called “News Slideshow”. And in the statement, have
   it get the category slug and append “slideshow” to it.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Meteor Slides] Conditional statement’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/meteor-slides_0f131a.svg)
 * [Meteor Slides](https://wordpress.org/plugins/meteor-slides/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/meteor-slides/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/meteor-slides/)
 * [Active Topics](https://wordpress.org/support/plugin/meteor-slides/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/meteor-slides/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/meteor-slides/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-meteor-slides-conditional-statement/#post-1767051)
 * Status: resolved