• devmitrovics

    (@devmitrovics)


    Hello,
    i have this query

    <?php $query = new WP_Query( 'cat=-3,-8' ); ?>
     <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
    
              <div class="blogSidebar">
                <h5><?php echo get_the_title(); ?></h5>
       <?php my_excerpt(veryshort);?>
               <a href="<?php echo get_permalink(); ?>">Read More</a>
              </div>
    
     <?php endwhile;
     wp_reset_postdata();
     else : ?>
     <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
     <?php endif; ?>

    But how can i limit just to show 1 last post? Tehere were some argument ebfore showpost ?

  • The topic ‘Query and Post limit’ is closed to new replies.