Viewing 5 replies - 1 through 5 (of 5 total)
  • Yes you can add the page nav, just add this below your loop:

    <?php if ($wp_query->max_num_pages > 1) : ?>
    				<?php if(function_exists('kad_wp_pagenavi')) { ?>
            			<?php kad_wp_pagenavi(); ?>
            		<?php } else { ?>
    			        <nav class="post-nav">
    		                <ul class="pager">
    		                  <li class="previous"><?php next_posts_link(__('&larr; Older posts', 'virtue')); ?></li>
    		                  <li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'virtue')); ?></li>
    		                </ul>
    		              </nav>
            		<?php } ?>
    				<?php endif; ?>

    and make sure your loop has : 'paged' => $paged,
    in the args.

    Kadence Themes

    Thread Starter constantinvlad2007

    (@constantinvlad2007)

    Thank you for your help.
    There is a mall problem though. I don’t know where to paste the code you gave me. Cant you tell me whre to find the “loop” you were talking about?
    Thank you!

    Did you say you made a page? Did you just drop the code into the page or did you not make a page template?

    Let me back up so I understand better, do you have a child theme installed? Did you create your own page template or are you trying to edit a theme template?

    Kadence Themes

    I have the same problem.
    My Home page equally https://www.kadencethemes.com/creating-a-home-page-with-virtue/
    But if I add the code to file: /virtue/templates/home/blog-home.php
    line 81:

    <?php endwhile; else: ?>
    						<li class="error-not-found"><?php _e('Sorry, no blog entries found.', 'virtue');?></li>
    					<?php endif; ?>
    
            <?php if ($wp_query->max_num_pages > 1) : ?>
    				<?php if(function_exists('kad_wp_pagenavi')) { ?>
            			<?php kad_wp_pagenavi(); ?>
            		<?php } else { ?>
    			        <nav class="post-nav">
    		                <ul class="pager">
    		                  <li class="previous"><?php next_posts_link(__('← Older posts', 'virtue')); ?></li>
    		                  <li class="next"><?php previous_posts_link(__('Newer posts →', 'virtue')); ?></li>
    		                </ul>
    		              </nav>
            		<?php } ?>
    				<?php endif; ?>        
    
    				<?php $wp_query = null; $wp_query = $temp;  // Reset ?>
    				<?php wp_reset_query(); ?>

    and add
    line 17:

    $wp_query->query(array(
    					  'paged' => $paged,

    Pagination is displayed but is not functional. I see only page 1.

    Hey slanedeti,

    Because of how the home page works you can’t add pagination to the blog-home module. The only thing that can have pagination is the main loop, so if you make your home page the latest posts page then you can have your home page a blog page but it won’t have the same layout as the latest posts module.

    Kadence Themes

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Aspect theme.’ is closed to new replies.