Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Error with gp hooks

Home Forums Support Error with gp hooks

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #448695
    Sebastián

    Im getting this error:

    [13-Dec-2017 15:16:07 UTC] PHP Parse error: syntax error, unexpected ‘}’ in /home/directory/public_html/wp-content/plugins/gp-premium/hooks/functions/hooks.php(22) : eval()’d code on line 19
    [13-Dec-2017 15:27:40 UTC] PHP Parse error: syntax error, unexpected ‘}’ in /home/directory/public_html/wp-content/plugins/gp-premium/hooks/functions/hooks.php(22) : eval()’d code on line 19
    [13-Dec-2017 15:59:03 UTC] PHP Parse error: syntax error, unexpected ‘}’ in /home/directory/public_html/wp-content/plugins/gp-premium/hooks/functions/hooks.php(22) : eval()’d code on line 19

    I already deleted the code i put on gp hooks for the breadcrumbs a week ago.

    Also im having troubles with my website and they told me that this is the only error im getting so maybe its related.

    Is there anything I can do to fix it?

    Thanks

    GeneratePress 2.0
    #448742
    Leo
    Staff
    Customer Support

    Hi there,

    That just looks like there is error in your content in GP hooks.

    What else is in there?

    #448834
    Sebastián

    This:

    add_action( ‘wp_footer’, ‘tu_add_script’ );
    function tu_add_script() { ?>
    <script>
    jQuery(function($) {
    $(document).on(‘click’, ‘a[href*=”#”]:not([href=”#”])’, function(e) {
    if (location.pathname.replace(/^\//,”) == this.pathname.replace(/^\//,”) && location.hostname == this.hostname) {
    var target = $(this.hash);
    target = target.length ? target : $(‘[name=’ + this.hash.slice(1) +’]’);
    if (target.length) {
    e.preventDefault();
    $(‘html,body’).animate({
    scrollTop: target.offset().top
    }, 500);
    }
    }
    });
    });
    </script>
    <?php }

    I don’t remember why I put it, honestly

    #448836
    Leo
    Staff
    Customer Support

    That looks like the smooth scroll script.

    It should go directly into wp_footer like this: https://generatepress.com/forums/topic/smooth-scroll-2/#post-439796

    #448837
    Sebastián

    I already deleted anyway because my website is having troubles to load.

    Let’s hope the error goes away.

    Thanks!

    #449020
    Leo
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.