Quantcast
Channel: User Michael - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 44

Answer by Michael for In category.php I need to get the next 10/previous 10 posts

$
0
0

if the only difference in the category archives is the images, you can work without a custom query.in this case you could use (as suggested here https://developer.wordpress.org/themes/functionality/pagination/#simple-pagination ):

<div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>     <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>

or any other suggestion from https://developer.wordpress.org/themes/functionality/pagination/

for the image, you need to change the img line in your category.php:

<h2><img src="<?php bloginfo('template_directory'); if( is_category( 'black-metal') ) { echo '/assets/img/black-metal-h2.png" alt="Black Metal"'; } elseif( is_category( 'death-metal') ) { echo '/assets/img/death-metal-h2.png" alt="Death Metal"'; } ?>/></h2>

Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>