[resolved] Add target applied to pagination links? (3 posts)

  1. shoelaced
    Posted 2 years ago #

    Hey all,

    I'm building a custom theme from a client's design, which involves a post feed situated somewhat down the page with some pagination links. It's a static home page, and the pagination is working fine, except that it reloads the page and thus, scrolls back to the top, which makes the user have to scroll down to see what the next post is.

    Example here (specifically the "Latest News" section): http://storkanishdesigns.com/artistsites.storkanishdesigns.com/samanthaschmid/

    The pagination code I've got is: <?php previous_posts_link($previous_posts_image); ?>

    Is there a way I can add a "#name" target to the pagination links, so that it'll load the new page in the scrolled down position?


  2. GenericBox
    Posted 2 years ago #

    I would just use a simple Slider jQuery to do it - it will look much cleaner and won't require a page refresh.

    jQuery Cycle is small and easy to use.

    Just run a new WP_Query to pull the Latest News and put them within a <div> tag and attach Cycle to the div.

  3. shoelaced
    Posted 2 years ago #

    Looked into the jQuery Cycle, but couldn't get it to work - it seems like all the slides have to be defined ahead of time?

    If anyone finds this page with the same question, here's what I did, which does work (scroll down to the pagination section):


Topic Closed

This topic has been closed to new replies.

About this Topic