• Hello there,

    I try to limit a query with showing only 5 posts.

    It looks like that :

    <?php
    					$highlights_category = get_category( ot_get_option( 'highlights_category', '0' ) );
    					if( !empty( $highlights_category ) ){
    					    if (isset($highlights_category->slug)) {
        					    $highlights_category = $highlights_category->slug;
    					    } else {
        					    $highlights_category = 'evenements';
    					    }
    
    					}else{
    						$highlights_category = 'evenements';
    					}
    					$args = array(
    						'posts_per_page' => 5,
    						'category_name' => $highlights_category
    					);
    				?>
    				<?php query_posts( '$args' ); // begin query ?>
    					<?php //begin loop for highlights content ?>
    					<?php if( have_posts() ){ ?>
    						<?php while( have_posts() ){ ?>
    							<?php the_post(); ?>

    that doesn’t work (alwaays have many posts)
    I tried ‘showposts’ => ‘5’, too, with the same result.

    Thank your for your help !

  • The topic ‘Query with array and showposts’ is closed to new replies.