Forums

[resolved] Next and Previous buttons not working on homepage (3 posts)

  1. BigScaryRobot
    Member
    Posted 2 years ago #

    Hi,

    My next and previous buttons aren't working on the homepage. They just reload the homepage. These buttons function on all other pages, though. I'm using the MT Dark theme.

    http://notstepfordwives.com/

    Any help would be much appreciated.

    Thanks!

  2. vtxyzzy
    Member
    Posted 2 years ago #

    That theme is not coded for pagination in index.php. You can add it by changing a few lines near the top of the file like this.

    Change this:

    <?php query_posts('orderby=random');
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    to this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("orderby=random&paged=$paged");
    if (have_posts()) : while (have_posts()) : the_post(); ?>
  3. BigScaryRobot
    Member
    Posted 2 years ago #

    You are my hero! Thanks so much! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.