• Hi. I currently have a site using a SA slider in the header. Because of the position, I embedded the shortcode <?php echo do_shortcode("[slide-anything id=x]"); ?> in header.php.

    This works fine, but the ID that is used on my localhost install and the ID on the actual production server are different. Of course I could just edit this one number when uploading to production — but is there an easier way to embed a slider without having to change to match the live site?

Viewing 1 replies (of 1 total)
  • Plugin Author simonpedge

    (@simonpedge)

    No, not at the moment.
    Also a problem I’ve encountered before using shortcodes for other plugins with template files and migrating a site from TEST to LIVE.
    I see certain premium plugins (e.g. Slider Revolution) allow for a ‘alias’ parameter – this is something I could introduce in the future.

    In the meantime you could try the following PHP:
    <?php
    if (get_site_url() == “http://LIVESITE.com&#8221;) {
    echo do_shortcode(“[slide-anything id=x]”); // LIVE shortcode
    } else {
    echo do_shortcode(“[slide-anything id=x]”); // TEST shortcode
    }
    ?>

    • This reply was modified 8 years, 11 months ago by simonpedge.
Viewing 1 replies (of 1 total)

The topic ‘Dynamic shortcode (local to production server)’ is closed to new replies.