Title: Plugin shortcode after post loads
Last modified: August 19, 2016

---

# Plugin shortcode after post loads

 *  Resolved [LoganSix](https://wordpress.org/support/users/logansix/)
 * (@logansix)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-shortcode-after-post-loads/)
 * I am creating a new plugin that uses shortcode for two items. One for each individual
   item and then another to combine links to the individual items.
 * i.e.
    [summary] [item id=”1″] [item id=”2″] [item id=”3″] [item id=”4″]
 * If I add the [summary] tag at the start of the post, it doesn’t get the values
   from the items. If I add it after the items, it get each of the items afterward.
   However, I want the [summary] shortcode to appear at the top of the post and 
   not at the bottom.
 * Any ideas? I tried to add the function at “end_loop”, but that didn’t work.

Viewing 1 replies (of 1 total)

 *  Thread Starter [LoganSix](https://wordpress.org/support/users/logansix/)
 * (@logansix)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-shortcode-after-post-loads/#post-1042011)
 * Okay, I figured it out!!
 * I created a function to add the shortcode after the content is called.
 *     ```
       function my_shortcode($content) {
       		   add_shortcode('myshortcode', array(&$this, 'myshortcodefunction'));
       		   return do_shortcode($content);
       		}
       ```
   
 * Then I added the function as an action
 * `add_action('the_content', array(&$this, 'my_shortcode'), 11);`

Viewing 1 replies (of 1 total)

The topic ‘Plugin shortcode after post loads’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [LoganSix](https://wordpress.org/support/users/logansix/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-shortcode-after-post-loads/#post-1042011)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
