1

I want to use Infinite Scroll in my WP theme for both Index, Category and Archive. The official WP plug-in doesn't seem to support IS for Category and Archive so I figured I'd make a manual install, however I can't get it to function properly.

For example, this is what my category.php looks like -

<?php get_header(); ?>

    <?php get_sidebar(); ?>

    <div id="category">
        <?php $category = get_the_category(); query_posts('cat=' . $category[0]->cat_ID . '&paged=' . $paged); ?>
        <?php while ( have_posts() ) : the_post(); ?>
            <article>
                <?php the_content(); ?>
            </article>
        <?php endwhile; ?>
    </div>

    <div id="pagination">
        <?php next_posts_link(); ?>
    </div>

<?php get_footer(); ?>

I include the latest release of IS found at https://github.com/paulirish/infinite-scroll/, then run it with it's default settings where I set #category to be the container in effect, and article the itemSelector. navSelector is set to #pagination and nextSelector to #pagination a:first, which seems right. Nothing happens, though I get no JS errors. I see the static next post link and it works as it should. What am I missing?

2

It's a little bit of code, so I'll ask you to take a look at this theme I did. It implements infinite scroll for the home page, category and tags, and i'll soon implement this functionality for other types of listings like archives and search.

  • Thanks, not sure I might be able to solve it but I'll have a look. – Staffan Estberg Aug 1 '12 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.