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: shortcode_atts_display-posts

Change the default arguments of the shortcode. For instance, if you want all shortcodes to have include_excerpt=”true” and include_author=”true”, you could use this to set it once and then not have to include those parameters on all shortcodes.

Use the WordPress date format

If you use the include_date=”true” parameter, Display Posts will include the post’s date using the (n/j/Y) format. Ex: You can customize this using the date_format parameter (see Formatting Dates and Times). WordPress lets you specify a default date format in Settings > General > Date Format. If you would like to use that format in […]

Posted byBill EricksonSeptember 11, 2019September 11, 2019Posted inDisplay Posts Shortcode

Display post count as title of listing

You can use the title parameter in the shortcode to add a title above the listing of posts. But what if you want that title to dynamically include the post count? We’ll use the shortcode_atts_display-posts filter to modify the default parameters for the shortcode. If the shortcode does not have a title specified, we’ll give […]

Posted byBill EricksonAugust 14, 2019August 14, 2019Posted inDisplay Posts Shortcode

Change Default Attributes

If you find yourself typing the same parameters over and over, you can save time by changing the default attributes. These can always be overridden by specifying new attributes on an individual shortcode. For instance, let’s say you always list 20 posts with excerpts: We can use the following to set these as the default: […]

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