Home Forums Support GP Hooks per page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #130274
    Michel

    The built-in hooks and the dashboard settings page for assigning hooks is very neat and handy. It would be cool if hooks could be assigned per page (in additional to global). I’m not sure if that would be too much for the WP Dashboard setup, or perhaps there’s a way to assign shortcode/php per page through the current settings page that I don’t know about.

    #130290
    Tom
    Lead Developer
    Lead Developer

    Hi Michel,

    You can actually use the WordPress conditionals found here: https://codex.wordpress.org/Conditional_Tags

    For example, if you wanted to target the front page:

    <?php if ( is_front_page() ) : ?>
          Stuff in here will only show on the front page
    <?php endif; ?>

    Or a specific page with an ID of 10:

    <?php if ( is_page( 10 ) ) : ?>
          This will show up on page ID 10
    <?php endif; ?>

    Just be sure to check “Execute PHP” if you’re using PHP within the hooks ๐Ÿ™‚

    #130598
    michel

    Geez, that was easy. Thanks.

    #130613
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚ Glad I could help

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