Tagged: 

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

    Hey guys!

    When visitors click to see the second page of posts (I use the blog posts section) they get booted to the top of the page. It throws visitors off and they bounce.

    How can I set it so people stay at the bottom of the page when they click to see more posts so they don’t leave.

    #445241

    Hi Courtney!

    Thank you for using Enfold.

    Place the blog inside a color section. Edit the color section, apply a unique id to the Section ID field. Use “blog-section” for example. Add this in the functions.php file:

    add_action('wp_footer', 'ava_custom_script', 10);
    function ava_custom_script(){
    ?>
    <script>
    (function($){	
    	var pagination = $("#top .pagination a"),
    		url = window.location.href,
    		initial = url.indexOf('/page/') >= 1;
    			
    	if(pagination.length >= 1 && initial) {				
    		$('html,body').animate({
    			scrollTop: $('#blog-section').offset().top
    		},2000);
    	}
    }(jQuery));
    </script>
    <?php
    }

    Best regards,
    Ismael

    #445467

    Thank you Ismael :)

    #446215

    Hi!

    Glad we could help :)

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Blog Posts’ is closed to new replies.