Support » Theme: Hapy » Older Newer Posts

  • On my Hapy theme there are Older Newer Posts buttons at the bottom of the Home page, the Archives, and the Categories pages, but not on my Blog page. I tried installing an Older Newer Posts plugin but couldn’t get it to run or show up or show an error message or anything. I am just trying to get Older Newer Posts on my Blog page. My website is minimalistgranny.com

    Thanks for any help you can give me.

    • This topic was modified 2 years, 2 months ago by  pbettis2017. Reason: forgot to put in my website
Viewing 3 replies - 1 through 3 (of 3 total)
  • the blog page is done with a custom page template with the file name template-blog-php;
    did you edit that template?

    your theme is a child theme of the ‘Hathor’ theme, and that template is in that thame.
    it actually has a call to a function for pagination, however, this function is not properly installed to work for the custom query in the blog page, nor to work with the ‘wp-pagenavi’ plugin.

    create a copy of the file pagination.php in your child theme (‘Hapy’), and edit it there;

    example code which might work:

    <!-- pagination -->
    	<?php if( is_page_template( 'template-blog.php' ) ) : 
    		
    		// allow for the custom query in the page template //
    		
    			global $the_query;
    			
    			if(function_exists('wp_pagenavi')) : 
    			
    			wp_pagenavi( array( 'query' => $the_query ) );
    				
    			else :
    		?>
    			<div class="wp-pagenavi">
    				<div class="alignleft"><?php next_posts_link('&laquo; '.__('Older posts','hathor'), $the_query->max_num_pages ) ?></div> 
    				<div class="alignright"><?php previous_posts_link(__('Newer posts','hathor').' &raquo;', $the_query->max_num_pages ) ?></div>
    			</div>
    		<?php endif; 
    		
    	else: 
    		
    		// for the default query index and archive pages //
    		
    			if(function_exists('wp_pagenavi')) : 
    			
    			wp_pagenavi();
    				
    			else :
    		?>
    			<div class="wp-pagenavi">
    				<div class="alignleft"><?php next_posts_link('&laquo; '.__('Older posts','hathor')) ?></div> 
    				<div class="alignright"><?php previous_posts_link(__('Newer posts','hathor').' &raquo;') ?></div>
    			</div>
    		<?php endif; 
    		
    	endif; ?>      
    <!-- /pagination -->

    to alert the theme’s developer about the problem, please post your question in https://wordpress.org/support/theme/hapy and in https://wordpress.org/support/theme/hathor

    Thank you so much! No, I didn’t edit “template-blog-php.” I wouldn’t know to try that, how to do that, what it even means, but I will give it a go, thanks!

    Because of my inexperience (being a TOTAL newbie), I was unable to figure out how to use your code, Michael, but I TRULY thank you for the help! I was able to contact the theme’s developer through his webpage. He responded:

    You can try this plugin :
    https://wordpress.org/plugins/wp-paginate/
    Or need to buy pro version
    Thanks

    I wasn’t confident with this recommended plugin since it hasn’t been updated in 4 years and is not tested with my theme, so instead I simply hid the page that wasn’t working right on my blog. (It’s still there; viewers just can’t see it.) It’s a suitable fix for my simple website.

    Thank you again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Older Newer Posts’ is closed to new replies.