[Resolved] Theme file – Add shortcode from plugin

Home Forums Support Theme file – Add shortcode from plugin

  • This topic has 1 reply, 2 voices, and was last updated 9 months ago by David.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1143413
    Patrik

    Hi,
    Many plugins say you can ad their shortcode to “theme”
    “To display your slideshow, add the following shortcode to your page. If adding the slideshow to your theme files, additionally include the surrounding PHP code.”

    On one page i display all of my posts and tried two different plugins,
    Search & Filter and seems like Content Views also have this function.

    So example:
    <?php echo do_shortcode(‘[metaslider id=”XXX”]’); ?>

    Why do you want it to Theme?
    How and where do i do it?

    Many thanks,
    Patrik

    #1143539
    David
    Staff
    Customer Support

    Hi there,

    simplest way to add it to the Theme is to use the Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.