WP_Query doesn't care some args
-
Hi, i’ve a custom query in the main page:
<?php $args = array( 'post_type' => 'post', 'post__in' => get_option('sticky_posts'), 'posts_per_page'=>3, 'paged' => 1, 'order' => 'rand' ); $my_query = new WP_Query($args); ?> <div id="sticky-home"> <?php while( $my_query->have_posts() ): $my_query->the_post(); ?> <?php $wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium'); //thumbnail ?> <a class="cbox" id="post-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" style="background: url('<?php echo $wpc_image_url[0]; ?>'); background-size: cover; background-position: center center; background-repeat: no-repeat;" > <h2><?php echo get_the_title(); ?> <?php echo wep_leggicaso(get_the_ID()); ?></h2> <div class="like"><?php echo wep_addlikecount(get_the_ID()); ?> like</div> <?php echo wep_addcontent(); ?> <!--<div class="date"><?php echo get_the_date(); ?><?php echo ' | di '.get_the_author(); ?></div>--> <!--<div class="looptext"><?php echo strip_tags(get_the_content('(continua...)')); ?></div>--> </a> <?php endwhile; ?> </div>
The problem is that the value ‘posts_per_page’ is not correct showed, i mean, the query display more than 3 posts. I really don’t understand where can be the problem. I’ve already deactivated all plugin but nothing change. Any help?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘WP_Query doesn't care some args’ is closed to new replies.