Title: Adding personal shortcode to tab issue
Last modified: April 17, 2017

---

# Adding personal shortcode to tab issue

 *  Resolved [mtn217](https://wordpress.org/support/users/mtn217/)
 * (@mtn217)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/)
 * Hi,
 * I’m having an issue where a personal shortcode that I created and have placed
   in one of my tabs isn’t showing up inside the tab but actually outside and above
   my tabs. Is it possible to add shortcodes to tabs?
 * Thank you.

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

 *  Plugin Author [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9037515)
 * This should work and I often use tabs with other shortcodes in their content 
   with no issues.
 * Please post a link to the page where I can see the issue and give details of 
   the shortcodes you are using including the code for your shortcode function.
 *  Thread Starter [mtn217](https://wordpress.org/support/users/mtn217/)
 * (@mtn217)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9039475)
 * Here is a page where this is happening: [http://ec2-52-89-248-121.us-west-2.compute.amazonaws.com/testing/](http://ec2-52-89-248-121.us-west-2.compute.amazonaws.com/testing/)
 * Here is the code I have for the page:
    [tabby title=”Payment Form”] [payment][
   tabbyending]
 * So the payment shortcode creates a form where the user is able to make a payment.
   I add it to the inside of the tab, but it only shows up on the outside of the
   tab.
 *  Plugin Author [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9039613)
 * what PHP code are you using for your shortcode function?
 *  Thread Starter [mtn217](https://wordpress.org/support/users/mtn217/)
 * (@mtn217)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9039626)
 * Here it is:
 *     ```
       function pippin_stripe_payment_form() {
   
       	global $stripe_options;
   
       	if(isset($_GET['payment']) && $_GET['payment'] == 'paid') {
       		echo '<p class="success">' . __('Thank you for your payment. Please check your email for your receipt.', 'pippin_stripe') . '</p>';
       	} else { ?>
       		<form action="" method="POST" id="stripe-payment-form">
       			<div class="form-row">
       				<label><?php _e('Amount*', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" placeholder="$20" name="user-amount"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('Email*', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" name="email"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('Name*', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" name="name"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('Street', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" name="address"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('City', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" name="city"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('Zipcode*', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" name="zipcode"/>
       			</div>
   
       			<div class="form-row">
       				<label><?php _e('Card Number*', 'pippin_stripe'); ?></label>
       				<input type="text" size="20" autocomplete="off" class="card-number"/>
       			</div>
       			<div class="form-row">
       				<label><?php _e('CVC*', 'pippin_stripe'); ?></label>
       				<input type="text" size="4" autocomplete="off" class="card-cvc"/>
       			</div>
       			<div class="form-row">
       				<label><?php _e('Expiration (MM/YYYY)*', 'pippin_stripe'); ?></label>
       				<input type="text" size="2" class="card-expiry-month"/>
       				<span> / </span>
       				<input type="text" size="4" class="card-expiry-year"/>
       			</div>
       			<?php if(isset($stripe_options['recurring'])) { ?>
       			<div class="form-row">
       				<label><?php _e('Payment Type:', 'pippin_stripe'); ?></label>
       				<input type="radio" name="recurring" value="no" checked="checked"/><span><?php _e('One time payment', 'pippin_stripe'); ?></span>
       				<input type="radio" name="recurring" value="yes"/><span><?php _e('Recurring monthly payment', 'pippin_stripe'); ?></span>
       			</div>
       			<?php } ?>
       			<input type="hidden" name="action" value="stripe"/>
       			<input type="hidden" name="redirect" value="<?php echo get_permalink(); ?>"/>
       			<input type="hidden" name="amount" value="<?php echo $_POST['user-amount']; ?>"/>
       			<input type="hidden" name="stripe_nonce" value="<?php echo wp_create_nonce('stripe-nonce'); ?>"/>
       			<button type="submit" id="stripe-submit"><?php _e('Submit Payment', 'pippin_stripe'); ?></button>
       		</form>
       		<div class="payment-errors"></div>
       		<?php
       	}
       }
       ```
   
    -  This reply was modified 9 years, 1 month ago by [cubecolour](https://wordpress.org/support/users/numeeja/).
      Reason: Added code backticks
 *  Plugin Author [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9040319)
 * The construction used in your function will not work well as as a shortcode function.
 * To illustrate this, delete the tab shortcodes to take them out of the equation
   and paste several paragraphs of [Lorem Ipsum filler text](http://loripsum.net/)
   to the top of your page. Then no matter where you add your shortcode within the
   filler text you will see that it will allways be output before that text.
 * To fix this, rewrite your code so the form is built as a string assigned as the
   value of a variable. Then return (not echo) the string at the end of the function.
 * Alternatively use an output buffer, eg
 * `ob_start();`
 * at the beginning of the function, and
 * `return ob_get_clean();`
 * at the end of the function.
 *  Thread Starter [mtn217](https://wordpress.org/support/users/mtn217/)
 * (@mtn217)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9041940)
 * It works again! I used the output buffer at the beginning and end of the function
   and it works now.
 * Thank you sooo much for your help! Love your plugin!

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

The topic ‘Adding personal shortcode to tab issue’ is closed to new replies.

 * ![](https://ps.w.org/tabby-responsive-tabs/assets/icon-256x256.jpg?rev=2682041)
 * [Tabby Responsive Tabs](https://wordpress.org/plugins/tabby-responsive-tabs/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tabby-responsive-tabs/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tabby-responsive-tabs/)
 * [Active Topics](https://wordpress.org/support/plugin/tabby-responsive-tabs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tabby-responsive-tabs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tabby-responsive-tabs/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [mtn217](https://wordpress.org/support/users/mtn217/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/adding-personal-shortcode-to-tab-issue/#post-9041940)
 * Status: resolved