Title: Loading shortcode after other code
Last modified: September 1, 2016

---

# Loading shortcode after other code

 *  [kylar101](https://wordpress.org/support/users/kylar101/)
 * (@kylar101)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/loading-shortcode-after-other-code/)
 * I have written some shortcode that pulls the ID from each heading and displays
   it in a table of contents for that particular page. It currently grabs all IDs
   that already exist on the headings.
 * I have also written some code that dynamically adds IDs to all headings if they
   don’t already have them. The shortcode does not pick up on these IDs.
 * I think it is because the shortcode loads in before the ID generating code runs.
   How do I change the load order of all of these pieces of code?

The topic ‘Loading shortcode after other code’ is closed to new replies.

## Tags

 * [load order](https://wordpress.org/support/topic-tag/load-order/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 0 replies
 * 1 participant
 * Last reply from: [kylar101](https://wordpress.org/support/users/kylar101/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/loading-shortcode-after-other-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
