Title: Problem with custom shortcode add-on (PHP-code)
Last modified: March 26, 2019

---

# Problem with custom shortcode add-on (PHP-code)

 *  Resolved [aviendha75](https://wordpress.org/support/users/aviendha75/)
 * (@aviendha75)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-custom-shortcode-add-on-php-code/)
 * Hi there
    I just got the license for the custom shortcodes add-on and I’m trying
   to implement this php-code. I know, I have to delete the <?php?>-tags, but it
   doesn’t work right.
 * Here the original php-code:
 *     ```
       <?php if ( my_wp_is_mobile() ) { ?>
       	<div class="section fp-auto-height">
       	    <div class="wrap-fix">
       		<div class="slide">
       <?php } elseif ( my_wp_is_tablet() ) { ?>
       	<div class="section fp-auto-height">
       	    <div class="wrap-fix">
       		<div class="slide">
       <?php } else { ?>
       	<div class="section">
       	    <div class="wrap-fix">
       		<div class="slide">
       <?php }?>
       ```
   
 * And I’ve tried that:
 *     ```
       if ( my_wp_is_mobile() ) {
       	<div class="section fp-auto-height">
       	    <div class="wrap-fix">
       		<div class="slide">
       } elseif ( my_wp_is_tablet() ) { 
       	<div class="section fp-auto-height">
       	    <div class="wrap-fix">
       		<div class="slide">
       } else {
       	<div class="section">
       	    <div class="wrap-fix">
       		<div class="slide">
       }
       ```
   
 * What’s wrong?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-custom-shortcode-add-on-php-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Vova](https://wordpress.org/support/users/gn_themes/)
 * (@gn_themes)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-custom-shortcode-add-on-php-code/#post-11357653)
 * Hi [@aviendha75](https://wordpress.org/support/users/aviendha75/),
 * you only need to remove the first and the last PHP tags:
 *     ```
       if ( my_wp_is_mobile() ) { ?>
       	<div class="section fp-auto-height">
       		<div class="wrap-fix">
       		<div class="slide">
       <?php } elseif ( my_wp_is_tablet() ) { ?>
       	<div class="section fp-auto-height">
       		<div class="wrap-fix">
       		<div class="slide">
       <?php } else { ?>
       	<div class="section">
       		<div class="wrap-fix">
       		<div class="slide">
       <?php }
       ```
   
 * Please do not use this forum for questions about premium add-ons. It’s prohibited
   by forum rules. Instead, contact me directly, here:
 * [https://getshortcodes.com/support/open-support-ticket/](https://getshortcodes.com/support/open-support-ticket/)
 *  Thread Starter [aviendha75](https://wordpress.org/support/users/aviendha75/)
 * (@aviendha75)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-custom-shortcode-add-on-php-code/#post-11357712)
 * Perfect, that did it!
    Thanks!

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

The topic ‘Problem with custom shortcode add-on (PHP-code)’ 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/)

## Tags

 * [add-on](https://wordpress.org/support/topic-tag/add-on/)
 * [custom shortcode](https://wordpress.org/support/topic-tag/custom-shortcode/)

 * 2 replies
 * 2 participants
 * Last reply from: [aviendha75](https://wordpress.org/support/users/aviendha75/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/problem-with-custom-shortcode-add-on-php-code/#post-11357712)
 * Status: resolved