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 […]
Filter: display_posts_shortcode_wrapper_close
Customize the outer closing 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 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
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: