• i created a shortcode for my site that allows them to have content show up in a lightbox. when the html for the lightbox content gets rendered, it is displayed inside of the parent tag that holds the shortcode.

    is there a way i can write my shortcode function to somehow hook into wp_footer and add dynamic content to it? having the lightbox content inside of the parent html tag is causing rendering issues sometimes.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Not entirely sure this will work, but it’s worth a try. From within your shortcode handler, add_action('wp_footer', 'your_callback'); where the your_callback() function echoes the footer content. The trick is how to get data passed from the shortcode handler to the action callback. I suggest using a transient.

Viewing 1 replies (of 1 total)
  • The topic ‘shortcode to add content to other parts of the page’ is closed to new replies.