Wordpress Plugin Installation

  1. Download the plugin.
  2. Install it to your /wp-content/plugins/ directory
  3. Activate the plugin in your Wordpress Admin UI.
  4. Visit the Settings / Infinite Scroll page to set up the css selectors.
  5. The plugin will now work for a logged in Admin, but will be disabled for all other users; you can change this.

CSS Selector Setup

You need configure the plugin with CSS selectors that match your theme.

Content CSS Selector
The DIV that wraps around all posts. New posts will be inserted at the bottom of this DIV.
Post CSS Selector
The selector that selects all posts on a page. Each post must be surrounded by a single DIV.
Navigation links CSS Selector
This DIV contains the Next Posts and Previous Posts link.
Previous Posts CSS Selector
This A tag is what points to the 2nd page of posts.

Troubleshooting

  • Your posts need to be wrapped in divs all next to each other.
  • You need a link on your page to the next page of posts.

FAQ

Can I change the number of posts loaded?
Yup. But that’s a Wordpress thing. Go to Settings / Reading
Is it SEO-Friendly?
Yes all enhancements are made via javascript only, so search spiders see no difference.
Is it accessible?
Things won’t change for screen-readers. This technique degrades gracefully.
Why doesn’t it work on ____ page?
Currently, the plugin is disabled for everything but the main page, but I’ll work on enabling it for Archives, Categories, and Tags.
Does it still keep going, even at the end of the blog?
Infinite scroll is configured to die when it hits a 404 Not Found status code, so when it goes through all your archives it should hit a /page/43/ (or something) that doesn’t exist, then show a message “Congrats, you’ve reached the end of the internet.” Some wordpress themes don’t report not found pages with a 404. Try a different theme or contacting the theme author.
Do I need to edit my theme to make this work?
Probably not, nope.
Will this do form posts for get new data?
Nope?
You mean it just works?
Yup.
Really?
I hope so. But due to the infinitudes of wordpress installations, each case is different. Different themes and other plugins may break infinite scroll’s functionality.

Customization

This information will probably help styling.

  • <div id="infscr-page-2" class="infscr-pages"> will contain the page 2 content, etc
  • <div id="infscr-loading"> is the loading div.

62 Responses to “Wordpress Plugin Installation”

  1. Jussi says:

    I now added links to Next&Previous Pages.

    I am using Content selector: #postings-list-in-loop
    and
    Post selector: .postings-list-posting

    unsuccessfull… Anyone?

    THX!

  2. Derrick says:

    I’ve tried everything but I cannot get this to work on my site. Please help!! My site is… itsallmindcontrol.com
    for the Content CSS Selector I have : #home blog col-2-left loggedin
    for the Post CSS Selector I have : #home blog col-2-left loggedin div.post
    for the Navigation Links CSS selector I have : navigation
    for the Previous Post CSS selector I have : div.post-date a:first

    can some please please help

  3. Paul Irish says:

    Derrick,

    nextSelector : “.page-navigation a:first”,
    navSelector : “.page-navigation”,
    contentSelector : “#primary-content”,
    itemSelector : “#primary-content div.post”

  4. Derrick says:

    Thank you so very much! Worked like a charm

  5. Cory B. says:

    I’m trying to get this to work on a draft of a project but I can’t figure out what my selectors are. I’ve tried several combinations but just can’t get anything to happen. Help?

    Email might be best. Thanks!

  6. Cory B. says:

    Why won’t this work with my theme? Is there anything I can change?

    I’m sure I have the selectors right. I don’t get an error or anything at all, it just shows up normally as if nothing has changed.

  7. Paul Irish says:

    Cory you have a js error with fancybox ( the script is 404ing)
    The might be breaking everythign for you

    as for selectors..
    #blog is the container but the rest are probably the defaults.

    gluck

  8. Zack says:

    Is there a way to use the Wordpress plugin similarly as the demo? I want to add a “read more” link, but the Wordpress plugin has no options to do this and loads the posts on scroll.

  9. Paul Irish says:

    @Zack,
    No that’s not really infinite scroll, but instead hooking up some ajax to a click event. It’s pretty damn easy to do with jQuery and the load() function (passing it a selector). I’d read up some tutorials about that and try my hand at it.
    Cheers

  10. Jason F says:

    hi paul,

    i saw that you support the twitter/facebook style manual trigger event to load the next array of posts… but… my javascript and php are so rusty i would not be able to implement it on my own. since your code automagically replaces the prev / next buttons, i would not know where to start. can you help out a novice easily implement the manual trigger? is it simple as dropping in a new function or something in The Loop? or could you supply me with more precise instructions on how to do it? i know its asking alot so i’ll understand if you dont/cant do it… also, any other plugins out there for wordpress that may mimic twitter ‘more’ pagination? i was not able to find any!

    thanks again for the cool plugin!

    thanks,
    jason.

  11. Martijn says:

    Hey Paul, thanks for the great plugin. I have 1 question; i’ve selected ‘enabled for all users’ but the magic only works when I’m logged in… Any tips?

  12. Ken Savage says:

    Could this work for comments instead of (or also) posts?

Leave a Reply