'posts_per_page' => 10 doesnt show 10 post?
-
Hi.
Ive made a “post per page ” limitation with category “Actors” based filtering. The problem is, this code checks the last 10 post and show only the ones with the “Actors” on it; which in result shows 3 or 4 posts.But i only want to show 10 “Actors” posts rather than the otherway around. Can you please help me?
<?php $loop = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 5) ); while ( $loop->have_posts() ) : $loop->the_post(); if(get_field('Actors') ) { echo '<li>'; echo '<a href="'; the_permalink(); echo '">'; the_title(); echo '</br><span> '; the_time('d/m/Y'); echo '</span></a></li>'; }else{ echo ''; } endwhile; ?>
Note: “if(get_field(‘Actors’)” is a custom field, and i think this problem is not occuring due to this ( since ive also tried has_term version.)
Thank you.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘'posts_per_page' => 10 doesnt show 10 post?’ is closed to new replies.