This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Some Contents Missing

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #30963
    Alex MedaAlex Meda
    Participant

    You cannot access this content.

    #30971
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #31002
    Alex MedaAlex Meda
    Participant

    You cannot access this content.

    #31008
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thanks! It was actually there, but the siteground optimizer moved it to an external file for caching, I could not see it there.

    I made a change to the actual script file, which may actually work, the final code is now:

    add_action('wp_footer', 'asp_custom_wp_footer');
    function asp_custom_wp_footer() {
      ?>
      <script>
      jQuery(function($) {
        var t;
        $('.asp_main_container').on('asp_search_start', function(){
            clearTimeout(t);
            var $this = this;
            t = setTimeout(function(){
    			$('body,html').animate({'scrollTop': $($this).offset().top - 240}, {"duration": 240});
            }, 50);
        });
      });
      </script>
      <?php
    }

    I had to disable the scroll to results feature for this to work. Please note that I cannot guarantee this code to work in all cases on all search bars. For further improvements, you may have to consult with an external developer as well.

    #31037
    Alex MedaAlex Meda
    Participant

    Thanks a lot I quickly tested it out with most of my search instances active on the frontend and the code seems to be working just as I expected 🙂
    But I will make sure to run some other tests a week later to make sure that it is permanent solution before moving the code to live website.

    Have a great week.

    #31147
    Alex MedaAlex Meda
    Participant

    You cannot access this content.

    #31150
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure, I mean this feature, it has to be turned off: https://i.imgur.com/7IiAZXq.png
    I see the code there, it actually does the thing, but because of that option it is not visible. Once you turned it off and cleared the cache it will be okay.

    #31186
    Alex MedaAlex Meda
    Participant

    Hi,
    I didn’t get the chance to update you last week but the solution that you implemented on live site is working fine 🙂
    Thanks a lot and have an amazing week.

Viewing 8 posts - 16 through 23 (of 23 total)
  • You must be logged in to reply to this topic.