Support

Problems with home page pagination in btExtended Theme (6 posts)

Languages

de | fr | es | 日本語

About This Topic

Tags

  1. rss saraitalia

    new member


    rss Posted 2 years ago
    #

    Hi Milo, I fell in love with your btExtended theme. I am customizing it in my local server before uploading it to my blog.
    I encountered one big problem I can't solve. I set my home page to show 6 posts, but I'd like very much to have a pagination at the end of the home page.
    I try to explain better: when I scroll down to the last post ( the 6th) shown on the home page all i find is a link to the 7th, while I'd like to have there a link to other 6 posts and so on. Kind of a page-navi stuff.
    I tried to tweak the code but can't solve it by myself.
    Could you please help me?
    Thank you so much and sorry for my English.
    Sara

  2. rss milo

    moderator


    rss Posted 2 years ago
    #

    You need another loop for that, use this

    <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=1'.'&paged='.$paged); ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

    where showposts=1 indicates the number of posts shown, any number possible, in yours it should be 4.

    original loop:

    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

  3. rss saraitalia

    new member


    rss Posted 2 years ago
    #

    I'm sorry but the problem isn't solved.
    Once i replace the original loop (<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> ) with your new one (<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=1'.'&paged='.$paged); ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>)
    all I get is this message:
    Parse error: syntax error, unexpected T_ELSE in /home/wp-content/themes/BTextended/home.php on line 34
    Can you help me?

  4. rss milo

    moderator


    rss Posted 2 years ago
    #

    Replace in your loop this lines:

    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    with

    <?php endwhile; ?>

    then you'll get this result: modified BT Extended theme.

  5. rss saraitalia

    new member


    rss Posted 2 years ago
    #

    I've done all you said but the result is always the same: at the end of the home page all I get is a link to the previous post... I've done nothing wrong and followed your instructions step by step, but nothing came..
    I also downloaded again the theme thinking that maybe you did the changing in the home.php file, but it's the same...
    Can you please help me?
    I love the theme but the pagination is very important for my site...

  6. rss milo

    moderator


    rss Posted 2 years ago
    #

    Download the
    home php file here
    and upload to your bt ex theme folder and overwrite the older file.

Reply

You must log in to post.

Design by milo

Milo designs web sites that strike the perfect balance between professional high-class graphics, functionality, usability, user experience, and high performance.