WordPress.org

Ready to get started?Download WordPress

Forums

template_redirect and shortcodes (2 posts)

  1. lerizzle
    Member
    Posted 3 years ago #

    I'm using shortcodes. Based on if a shortcode is in the code I want to use a different template (all for custom post types)

    Now I assume that my action hooks 'template_redirect' has passed by the the time add_shortcode runs?

    Is there an easy way to trigger a new template only if a shortcdoe is found?

  2. Luke Gedeon
    Member
    Posted 3 years ago #

    @lerizzle have you considered using a custom page template that the user can select instead of using a short-code at all?

    It would of course depend a bit on how you are using the short-codes. Perhaps a little more detail would help us find a workable solution.

Topic Closed

This topic has been closed to new replies.

About this Topic