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

    Hi Kriesi,

    Auf der Startseite eines Kunden habe ich 3 News in Form eines Blogs. Das Problem ist, wenn man dort auf den nächsten Eintrag klickt, also von 1 auf 2 oder 3 springt die Seite jedesmal wieder nach oben und die Leute müssen wieder runterscrollen. Kann man das nicht irgendwie ändern?

    #443602

    Hey!

    Set a custom ID (ex: “blog-sektion”) to the section containing the blog element, then add this to functions.php:

    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	$("#blog-sektion .pagination-wrap a").each(function(){
                 var theHref = $(this).attr('href')+"#blog-sektion";
                 $(this).attr('href', theHref);
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Cheers!
    Josue

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