WordPress.org

Support

Support » Themes and Templates » Responsive » [Resolved] Can't make pagination work on a Blog-excerpt as a home page

[Resolved] Can't make pagination work on a Blog-excerpt as a home page

  • I need to set up the blog-exerpt as a home page and even though it wasn’t difficult to set up the pagination doesn’t work since I did it.
    What happens is that when I go to the home page from the navigation – pressing the button “Home” – it all looks and works as expected. If I just go to the index.php though – I mean directly to the main URL – without pressing any buttons, then once I go to the next page it seems all messed up.
    I’m using this code in the index.php
    <div class=”content”>
    <?php the_excerpt(); ?>
    </div>’

    and for pagination I use the following function
    function kriesi_pagination($pages = ”, $range = 2)
    {
    $showitems = ($range * 2)+1;

    global $paged;
    if(empty($paged)) $paged = 1;

    if($pages == ”)
    {
    global $wp_query;
    $pages = $wp_query->max_num_pages;
    if(!$pages)
    {
    $pages = 1;
    }
    }

    if(1 != $pages)
    {
    echo “<div class=’pagination’>”;
    if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo “«“;
    if($paged > 1 && $showitems < $pages) echo ““;

    for ($i=1; $i <= $pages; $i++)
    {
    if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
    {
    echo ($paged == $i)? “<span class=’current’>”.$i.”</span>”:”“.$i.”“;
    }
    }

    if ($paged < $pages && $showitems < $pages) echo ““;
    if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo “»“;
    echo “</div>\n”;
    }
    }

    It seams to be trying to load next page using the home.php instead of blog-exerpt.php

    I’m working with the Responsive Child Theme ver.1.0

    Thanks a lot in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Can't make pagination work on a Blog-excerpt as a home page’ is closed to new replies.
Skip to toolbar