[Resolved] Hook element not loading on front page

Home Forums Support [Resolved] Hook element not loading on front page

Home Forums Support Hook element not loading on front page

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #859879
    Jakob Smith

    I have a hook element with some javascript, that I have set to load in wp_footer on the page that is set as front page and another page, in “Display rules”.

    But on the page, that is set as front page, the code is not loaded.

    Here is the code:

    <script type="text/javascript">
    jQuery(document).ready(function($) {
    	$('.ab-block-cta').bind('click', function() {
    	window.location = $(this).find('a').attr('href');
    	});
    });
    </script>

    You see it on the link provided in “Your website URL”/ydelser

    But not on the front page.

    How can this be?

    #859949
    David
    Staff
    Customer Support

    Hi there,

    i can’t see the link, can you edit your original topic and re-add the Site URL. Make sure it is a valid URL as this may be getting rejected.

    #859950
    Jakob Smith

    Just edited the original topic and added the URL where the script is visible.

    #859957
    David
    Staff
    Customer Support

    In your display rules are you using the Location: Pages ?
    If so can you select the Front Page instead.

    #859963
    Jakob Smith

    Thanks, that works, along with the other page.

    But when the specified frontpage-page is also selectable, others might get into the same problem.

    #859974
    David
    Staff
    Customer Support

    Glad to hear that.
    Yes, unfortunately the way WP works is the Front Page doesn’t have a specific URL/slug hence the need for that dedicated display rule. And there isn’t a way of filtering out the actual page.

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