Title: Alternative Shortcode
Last modified: April 22, 2018

---

# Alternative Shortcode

 *  Resolved [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/)
 * Hi there,
 * sadly I had to choose an alternative shortcode for photonic.
    this does work 
   for me, but:
 * I’ll have to edit the generated shortcode manually after inserting it, because
   the generator still inserts “Gallery” and not my alternate “photonic”
 * is there a way, I can change this, so that I don’t have to manually edit my inserted
   codes…?

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

 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206843)
 * I am not sure I am following. Are your new shortcodes still being inserted with“
   gallery” instead of “photonic”? Or is it that you have already created many galleries
   so far and you want to change them to use “photonic”? If it is the latter you
   desire, that is not possible because there is no way for Photonic to know where
   to keep “gallery” and wher to use “photonic”
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206852)
 * new ones are still being inserted with “gallery”
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206864)
 * That is weird. Are your other settings being effective? What happens if you change
   your lightbox? Does that take effect? Are you using the visual editor or the 
   text editor?
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206885)
 * all other settings take their effects.
    I tried both, the visual and the text-
   only editor but the shortcode gets always inserted with “gallery” :/
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206897)
 * Ok. I will take a look as soon as I can get to a computer. Which version of the
   plugin are you on?
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206910)
 * I’m on 1.65
    in the privious version I found a workaround by editing one of the
   plugin’s files to insert “photonic”… but since the update some days ago, that’s
   gone, of course… and now I can’t find the right place to work around this again…
   🙂
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206917)
 * I see. This feature has actually worked from version 1 of the plugin, so my suspicion
   is that something in your theme or one of the other plugins (basically whatever
   is defining its own variant of “gallery”) is highjacking the “Add Media” dialog.
   I will look into it nonetheless.
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206924)
 * thx 🙂
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10206991)
 * When you go to edit or create a page or a post, can you execute the following
   steps?
    1. Do a “View Source” in your browser
    2. Search for _Photonic\_Admin\_JS_
    3. Tell me what you see in that line
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10207028)
 * <script type=’text/javascript’>
    /* <![CDATA[ */ var Photonic_Admin_JS = {“shortcode”:”
   photonic”,”default_gallery_type”:”flickr”,”plugin_dir”:”http:\/\/www.mk-concert-
   photos.de\/wp-content\/plugins\/photonic\/”}; /* ]]> */ </script>
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10207084)
 * OK – it looks like I introduced this bug in version 1.63.
 * To fix, you will have to do the following:
    1. Go to the file wp-content/plugins/photonic/admin/add-gallery.php
    2. At the top of this file you will see this line:
        `$selected_tab = isset($_GET['
       photonic-tab']) ? esc_attr($_GET['photonic-tab']) : 'default';`
    3. Before the above line, put in:
    4.     ```
           global $photonic_alternative_shortcode;
           $shortcode = empty($photonic_alternative_shortcode) ? 'gallery' : $photonic_alternative_shortcode;
           ```
       
    5. Around line 45 you will see this:
        `var shortcode = "[gallery type='<?php echo
       $selected_tab; ?>' ";`
    6. Change it to this:
        `var shortcode = "[<?php echo $shortcode; ?> type='<?php
       echo $selected_tab; ?>' ";`
 * Let me know if this works, and I will update the code with it.
 *  Thread Starter [serpentes](https://wordpress.org/support/users/serpentes/)
 * (@serpentes)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10207142)
 * yep, that did the job for me 🙂
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10474929)
 * I have put this fix in for version 1.66.

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

The topic ‘Alternative Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/photonic/assets/icon.svg?rev=1972449)
 * [Photonic Gallery & Lightbox for Flickr, SmugMug & Others](https://wordpress.org/plugins/photonic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photonic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photonic/)
 * [Active Topics](https://wordpress.org/support/plugin/photonic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photonic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photonic/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/alternative-shortcode/#post-10474929)
 * Status: resolved