Title: Shortcode within link
Last modified: August 21, 2016

---

# Shortcode within link

 *  Resolved [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * (@erichoegee)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/)
 * Hi,
 * First of all I love the plugin. I got one big problem though:
 * I need to use iframe within the link. I installed a plugin for that (Advanced
   iFrame) which gives me a shortcode. (‘[advanced_iframe securitykey=”xxxxxxx” 
   src=”[http://www.sears.com&#8221](http://www.sears.com&#8221); width=”100%” height
   =”550px”]’)
 * If i copy this shortcode in my link field it will not work. It strips everything
   untill where my securitykey starts. (‘[advanced_iframe securitykey=’)
 * Is there any way i can make it work like I want?
 * [http://wordpress.org/plugins/simple-links/](http://wordpress.org/plugins/simple-links/)

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

 *  Plugin Author [Mat Lipe](https://wordpress.org/support/users/mat-lipe/)
 * (@mat-lipe)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012386)
 * Hi Eric,
 * You may use the description field to enter your shortcode. Then you will have
   to enable shortcode support by using a couple of the built in filters. You may
   add the code to your theme’s functions.php file.
 *     ```
       add_filter('simple_links_shortcode_link_meta', 'sl_do_shortcodes');
       add_filter('simple_links_shortcode_link_output', 'sl_prevent_shortcode', 99, 4);
       function sl_prevent_shortcode($link_output, $meta, $link, $image ){
           $link_output = sprintf('<a href="%s" target="%s" title="%s" %s>%s%s</a>',
                                           $meta['web_address'][0],
                                           $meta['target'][0],
                                           $link->post_title,
                                           empty( $meta['link_target_nofollow'][0] ) ? '': 'rel="nofollow"',
                                           $image,
                                           $link->post_title
                                    );
           return $link_output;
   
       }
   
       function sl_do_shortcodes($meta){
           if( isset( $meta['description'][0] ) ){
               $meta['description'][0] = do_shortcode($meta['description'][0]);
           }
           return $meta;
       }
       ```
   
 * Hope this helps!
 *  Thread Starter [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * (@erichoegee)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012433)
 * Hi Mat,
 * Thanks for your advice and code. I placed it in my theme’s functions.php I placed
   the shortcode in my description field. I guess I need to leave the Web Address
   field empty right? Anyway, i can’t get it to work. Could you maybe take a look
   and point me the way? I would be forever grateful! 🙂
 * On [http://www.mimallz.com/stores/department-stores-2/](http://www.mimallz.com/stores/department-stores-2/)
   you will find a link to sears.com that is supposed to run the shortcode.
 * Hope to hear from you, if you got any questions don’t hesitate…
 *  Thread Starter [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * (@erichoegee)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012439)
 * Hi Mat,
 * The URL right now leads me to the where i am now. So on my [http://www.mimallz.com/stores/](http://www.mimallz.com/stores/)
   pages it leads me to [http://www.mimallz.com/stores/](http://www.mimallz.com/stores/).
   If i click the link in [http://www.mimallz.com/stores/department-stores-2/](http://www.mimallz.com/stores/department-stores-2/)
   it leads me [http://www.mimallz.com/stores/department-stores-2/](http://www.mimallz.com/stores/department-stores-2/)
 * Maybe that helps 🙂
 * Thanks in advance
 *  Plugin Author [Mat Lipe](https://wordpress.org/support/users/mat-lipe/)
 * (@mat-lipe)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012469)
 * Hi Eric,
    When you add the shortcode to your content do you have the description
   turned on?
 * If not your shotcode should look something like this.
    `[simple-links description
   ="true"]`
 * To make it link out to you will want to fill in the Web Address field.
 * To hide the link and just display the iframe content you could use some css like
 *     ```
       .simple-links-shortcode-item a{
       display: none;
       }
       ```
   
 * Hope this helps!
 *  Thread Starter [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * (@erichoegee)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012544)
 * Hi Mat,
 * Thanks for your tips yet again 🙂 Now the iframe opens up, not really like i 
   would want it though. 😉
 * I don’t think you understand what I am trying to accomplish here. The idea is
   that I can have lists of links under each other. I am making a selection of web
   shops (300+) which i put on different pages with categories. So, I make a link,
   I put it in Category Department stores. I want it to be displayed just on the
   pages i selected the category for (could be multiple). So far it works.
 * On these pages I want only links, no iframes.
 * When links are being clicked I want another page to be opened, within that page
   the iframe must be opened.
 * Hope i made myself clear this time and really hope you are capable and willing
   to help me out yet again. 🙂
 * Thanks and have a good one,
 * Eric
 *  Plugin Author [Mat Lipe](https://wordpress.org/support/users/mat-lipe/)
 * (@mat-lipe)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012583)
 * Hi Eric,
 * I’m afraid this is a little beyond my free support.
 * You might give the main wordpress.org forum a try and see if someone from the
   community can give you a hand. I am totally swamped right now with client work.
 *  Thread Starter [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * (@erichoegee)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012584)
 * Hi Mat,
 * I can imagine, no problem. Thanks for all your help anyway!
 * Thanks 🙂

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

The topic ‘Shortcode within link’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-links_3d6e81.svg)
 * [Simple Links](https://wordpress.org/plugins/simple-links/)
 * [Support Threads](https://wordpress.org/support/plugin/simple-links/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-links/reviews/)

## Tags

 * [iframe](https://wordpress.org/support/topic-tag/iframe/)
 * [links](https://wordpress.org/support/topic-tag/links/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [shortcode in shortcode](https://wordpress.org/support/topic-tag/shortcode-in-shortcode/)

 * 7 replies
 * 2 participants
 * Last reply from: [eric.hoegee](https://wordpress.org/support/users/erichoegee/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/shortcode-within-link/#post-4012584)
 * Status: resolved