[Support request] Executing a hook on a specific page, is this possible?

Home Forums Support [Support request] Executing a hook on a specific page, is this possible?

Home Forums Support Executing a hook on a specific page, is this possible?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #418952
    Dave

    I have a script that works well in the wp_footer hook section. This is the script from Calendly:

    <!– Calendly badge widget begin –>
    <link href=”https://assets.calendly.com/assets/external/widget.css&#8221; rel=”stylesheet”>
    <script src=”https://assets.calendly.com/assets/external/widget.js&#8221; type=”text/javascript”></script>
    <script type=”text/javascript”>Calendly.initBadgeWidget({url: ‘https://calendly.com/dave-ellison/15-min&#8217;, text: ‘Schedule call with me!’, color: ‘#00a2ff’, branding: false});</script>
    <!– Calendly badge widget end –>

    Is it possible to execute this hook only on a specific page or pages? I’m not a coder and I can use an iframe embed code if needed, but this would work better. As it stands now, it shows the button on every page of the site. (I have disabled this hook since this is a live site, so it does not show up).

    Any suggestions are appreciated.

    Thanks,

    Dave ~

    #419034
    Leo
    Staff
    Customer Support

    Hi there,

    Should be something like this:

    <?php if ( is_page( 'page slug' ) ) : ?>
          code here
    <?php endif; ?>

    More info here: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

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