Title: Conditional Statements
Last modified: August 22, 2016

---

# Conditional Statements

 *  [Jarod Thornton](https://wordpress.org/support/users/jarmerson/)
 * (@jarmerson)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/conditional-statements-4/)
 * Hi,
 * Again, great plugin and I’m loving the custom shortcodes creator. I need some
   help with my echo php…
 * I’m a novice in php so please be patient – I can figure it out with some input.
 * Ok, I have a custom shortcode that inputs your tabs shortcode and it works perfectly.
   I have all the attributes set and it works, but I noticed it doesn’t follow the
   logic of what the shortcode is desired to do.
 * I had assumed when a switch is off the attribute would not be included but I 
   believe my php is the culprit because it’s not following the logic intended.
 * In my php I need conditions set so if a switch is off that attribute is not included
   in the output.
 * For example, I have tabs that include 5 switches. If any given switch is off 
   I need it excluded. At this time it is included no matter what. Maybe I’m using
   the custom shortcode creator wrong too.
 * Any insight is greatly appreciated.
 * Forgive my errors in php, I’ve tried several variations and here’s what I have.
 *     ```
       $tabs_open = '[su_tabs vertical="yes"]';
       $tabs_close = '[/su_tabs]';
       $available_work = '[su_tab title="AVAILABLE WORK"]<h4>AVAILABLE WORK</h4>[portfolio_grid column="2" showposts="40" cat="available-work-'.$artist_slug.'" disable="excerpt,date,more,visit"][/su_tab]';
       $exhibitions = '[su_tab title="EXHIBITIONS"]
       <h4>EXHIBITIONS</h4>[portfolio_grid column="2" showposts="40" cat="exhibits-mary-newton" disable="excerpt,date,more,visit,pagination"][/su_tab]';
       $artist_statement = '[su_tab title="ARTIST STATEMENT"]<h4>ARTIST STATEMENT</h4>'.$artist_statement_text.'[/su_tab]';
       $biography = '[su_tab title="BIOGRAPHY"]<h4>BIOGRAPHY</h4>'.$biography_text.'[/su_tab]';
       $press = '[su_tab title="PRESS"]<h4>PRESS</h4>[portfolio_grid column="2" showposts="40" cat="press-mary-newton" disable="excerpt,date,more,visit,pagination"][/su_tab]';
   
       echo do_shortcode($tabs_open.$available_work.$exhibitions.$artist_statement.$biography.$press.$tabs_close);
       ```
   
 * This outputs all tabs, switched or not.
 * [https://wordpress.org/plugins/shortcodes-ultimate/](https://wordpress.org/plugins/shortcodes-ultimate/)

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

 *  [curiousgdesign](https://wordpress.org/support/users/curiousgdesign/)
 * (@curiousgdesign)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-statements-4/#post-5482942)
 * Did you ever get any clarity on this, either through the plugin author or on 
   your own? I am having a similar issue with tabs and conditionals (see [https://wordpress.org/support/topic/vertical-tabs-and-conditional-statements-tabs-not-hidden?replies=1#post-7388142](https://wordpress.org/support/topic/vertical-tabs-and-conditional-statements-tabs-not-hidden?replies=1#post-7388142))
   and wondered if you ever found a workaround? Thanks in advance!
 *  Thread Starter [Jarod Thornton](https://wordpress.org/support/users/jarmerson/)
 * (@jarmerson)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-statements-4/#post-5482943)
 * Unfortunately I did not. I was short on budget so I opted to just setup a cheatsheet
   for my client and show them the shortcode syntax.

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

The topic ‘Conditional Statements’ is closed to new replies.

 * ![](https://ps.w.org/shortcodes-ultimate/assets/icon-256x256.gif?rev=2547563)
 * [Shortcodes Ultimate - Content Elements](https://wordpress.org/plugins/shortcodes-ultimate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcodes-ultimate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-ultimate/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-ultimate/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jarod Thornton](https://wordpress.org/support/users/jarmerson/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/conditional-statements-4/#post-5482943)
 * Status: not resolved