WP_Query and limit post
-
I have the following code from a WP site that a client give to me already set.
<?php
$featured_args = array(
‘post__in’ => get_option( ‘sticky_posts’ ),
);$featured_loop = new WP_Query( $featured_args );
while( $featured_loop->have_posts() ) :
$featured_loop->the_post();?>
Problem is, I just want to show the latest 5 sticky posts, and no more. Already tried methods here on forums to resolve it, but none worked. ?Can someone help me?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘WP_Query and limit post’ is closed to new replies.