Skip to content
Display Posts

Display Posts

The simplest way to display a listing of posts in WordPress.

  • Home
  • Tutorials
  • Documentation
    • Documentation
    • Parameters
    • Filters
    • The Output Filter
    • Extensions
  • Support
  • More
    • Back

Filter: display_posts_shortcode_wrapper_open

Customize the outer opening markup for the entire listing. By default it is ul but can be changed to ol or div using the ‘wrapper’ attribute. Use this filter to change it to any HTML element.

Display posts as a select dropdown

The Display Posts plugin lets you create a list of posts using a wide range of query parameters. It will display the result as a bulleted list by default. The code below will turn it into a select dropdown, and selecting a post will take you directly to that post. After adding the code to […]

Posted byBill EricksonFebruary 8, 2021February 11, 2021Posted inDisplay Posts Shortcode

Reversed Ordered List

You can use the wrapper parameter to change the bulleted (unordered) list to a numbered (ordered) list: Example: But what if you want the numbers to go in reverse? Example: Once the code at the bottom of this post has been added to your site, you can reverse an ordered list by adding reversed=”true”.

Posted byBill EricksonApril 17, 2020April 17, 2020Posted inDisplay Posts Shortcode

Display results as a table

On Dog Food Advisor we use Display Posts to dynamically list the best dog foods based on different criteria. In some areas we wanted to display these results as a table: The code below updates the listing to a table when the layout=”editors-choice” parameter is set. Shortcode Code

Posted byBill EricksonMarch 18, 2019March 18, 2019Posted inDisplay Posts Shortcode

Adapt listing layout based on number of items

The Post Grid styling works great if you know how many posts will be returned, but it doesn’t look good to have a single post in a 3 column grid. The code below will add an additional class to the wrapper indicating the number of posts in the result (ex: count-4). You can then adjust […]

Posted byBill EricksonFebruary 25, 2019February 25, 2019Posted inDisplay Posts Shortcode

Use section element for wrapper

Display Posts outputs an unordered list (<ul>) by default, but you can change this to an ordered list or div using If you would prefer a different wrapping element, like a <section>, you can use the following:

Posted byBill EricksonJanuary 4, 2019January 4, 2019Posted inDisplay Posts Shortcode
Display Posts by Bill Erickson