Title: Adding shortcode for tabs to PHP file
Last modified: August 30, 2016

---

# Adding shortcode for tabs to PHP file

 *  [startershut](https://wordpress.org/support/users/startershut/)
 * (@startershut)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/adding-shortcode-for-tabs-to-php-file/)
 * HI.
 * I was just wondering about how best to use shortcakes within PHP.
    I think I 
   have it right but seems to be a problem of calling a custom attribute within 
   the php?
 * Any suggestions of how to have single quotes within the do_shortcode?
    I have
   tried double quotes at the start or double quotes around the single quote in 
   the #ATT call but both don’t produce anything.
 *     ```
       <?php echo do_shortcode(
       	"[tabs slidertype='top tabs']
       	[tabcontainer]
       	[tabtext] Event Details [/tabtext]
       	[tabtext] Sponsors [/tabtext]
       	[tabtext]Terms & Conditions [/tabtext]
       	[/tabcontainer]
       	[tabcontent]
       	[tab] Content [/tab]
       	[tab] <?php echo $EM_Event->output('#_ATT{Sponsors'}) ?> [/tab]
       	[tab] <?php echo $EM_Event->output('#_ATT{Terms}') ?> [/tab]
       	[/tabcontent] [
       	/tabs]"); ?>
       ```
   
 * Thanks
    Troy

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

 *  anonymized-13749270
 * (@anonymized-13749270)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/adding-shortcode-for-tabs-to-php-file/#post-6441553)
 * have you tried this, maybe ?
 *     ```
       $sponsors = $EM_Event->output('#_ATT{Sponsors}');
       $terms = $EM_Event->output('#_ATT{Terms}');
   
       echo do_shortcode( "
       		[tabs slidertype=\"top tabs\"]
       			[tabcontainer]
       				[tabtext] Event Details [/tabtext]
       				[tabtext] Sponsors [/tabtext]
       				[tabtext]Terms & Conditions [/tabtext]
       			[/tabcontainer]
       			[tabcontent]
       				[tab] Content [/tab]
       				[tab] $sponsors [/tab]
       				[tab] $terms [/tab]
       			[/tabcontent]
       		[/tabs]
       	");
       ```
   
 *  Thread Starter [startershut](https://wordpress.org/support/users/startershut/)
 * (@startershut)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/adding-shortcode-for-tabs-to-php-file/#post-6441667)
 * Thanks.
 * I was able to get the tabs to display, but it displays $sponsors and $terms within
   the pages rather than the attributes?
 * Any other thoughts it looks like everything is in comments rather than individual
   parts
    `<?php $sponsors = $EM_Event->output(‘#_ATT{Sponsors}’); $terms = $EM_Event-
   >output(‘#_ATT{Terms}’);
 * echo do_shortcode(‘
    [tabs slidertype=”top tabs”] [tabcontainer] [tabtext] Event
   Details [/tabtext] [tabtext] Sponsors [/tabtext] [tabtext]Terms & Conditions [/
   tabtext] [/tabcontainer] [tabcontent] [tab] Content [/tab] [tab] $sponsors [/
   tab] [tab] $terms [/tab] [/tabcontent] [/tabs]’) ?>;
 *  <div class=”booking-form”>
 *  <?php echo $EM_Event->output(‘#_BOOKINGFORM’); ?>’
 * Thanks
 *  anonymized-13749270
 * (@anonymized-13749270)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/adding-shortcode-for-tabs-to-php-file/#post-6441668)
 *     ```
       echo do_shortcode('
       					[tabs slidertype="top tabs"]
       						[tabcontainer]
       							[tabtext] Event Details [/tabtext]
       							[tabtext] Sponsors [/tabtext]
       							[tabtext]Terms & Conditions [/tabtext]
       						[/tabcontainer]
       						[tabcontent]
       							[tab] Content [/tab]
       							[tab] '. $EM_Event->output('#_ATT{Sponsors}') .' [/tab]
       							[tab] '. $EM_Event->output('#_ATT{Terms}') .' [/tab]
       						[/tabcontent]
       					[/tabs]
       				');
       ```
   

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

The topic ‘Adding shortcode for tabs to PHP file’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: anonymized-13749270
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/adding-shortcode-for-tabs-to-php-file/#post-6441668)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
