Title: Limit loop output
Last modified: September 11, 2018

---

# Limit loop output

 *  [iralmit](https://wordpress.org/support/users/iralmit/)
 * (@iralmit)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/limit-loop-output/)
 * Hi,
    Really helpful plugin!
 * I am trying to display 3 products (custom post types) based on certain criteria
   and sort on best rating.
 * Could it somehow be possible to limit the output #number of posts from a [loop]
   when it is combined with [if] statements?
 * When I use the [count] argument it will only limit the iterations before the [
   if] statement, therefore the output #number of posts becomes various in length,
   hence unusable.
 * Or am I looking from the wrong perspective?
 * Example, something like:
    [loop count=3 type=items orderby=field_num key=rating
   order=DESC clean=true taxonomy=item_type term=refrigerators] [if field=content
   contains=’Refrigerator with freezer’ exact=true] [content] [/if] [/loop] Usually
   results in less then three items being displayed.

The topic ‘Limit loop output’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

## Tags

 * [output](https://wordpress.org/support/topic-tag/output/)

 * 0 replies
 * 1 participant
 * Last reply from: [iralmit](https://wordpress.org/support/users/iralmit/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/limit-loop-output/)
 * Status: not resolved