Display Posts includes a few different options for wrappers (unordered list, ordered list, and div) but all of these are block-level elements. That means they display as their own unique block on the page. If you want to display the most recent post inside a paragraph, we’ll need to use an inline element. The code snippet […]
If a user is logged in and has permission to edit/delete an article, this snippet will add a “Delete Post” link at the end of the listing for them to do so.
WordPress lets you mark posts as “sticky” so they appear at the top of listings, regardless of publish date. You can prevent sticky posts from appearing at the top of Display Posts using: This doesn’t actually exclude sticky posts, it just prevents them from appearing at the top. Display sticky posts After adding the code […]
Display Posts can include a list of terms associated with each post in the listing. These can be categories, tags, or any custom taxonomy. If you set category_display=”true” it will include a listing of the categories. You can also list tags ( category_display=”post_tag”) or any custom taxonomy ( category_display=”taxonomy_name”). Here’s an example from this site. […]
Comment count can be a great indicator of a post’s popularity. You can use the orderby parameter to change how Display Posts sorts the results. If you have more social engagement than on-site commenting, you might try listing popular content by share count instead.
When displaying a list of posts, Display Posts uses the number you have set in Settings > Reading > “Blog pages show at most” by default. But you can change this using the posts_per_page parameter in a shortcode. For instance, if you only wanted to list two posts, use: If you want to list every […]
Display Posts can be used to list – or exclude from listing – any content you’ve marked as “Private” or set with a password. Private Content Display Posts does not show private posts by default. It limits results to content with the “publish” status. If you create a private page, then use Thank YouThe Output […]
There are 8 parameters for managing date queries: date — Serves as a shortcut to setting the ‘year’, ‘month’, and ‘day’ arguments for a given date query struct on the second-level. It accepts either a strictly-formatted ‘YYYY-MM-DD’ date string or a relative-formatted date string, such as ‘Sunday, September 7’. The relative-formatted string is intended as a […]
Taxonomies are tools for organizing content in WordPress. Categories and tags are built-in taxonomies, and you can create additional taxonomies. Use the parameters below to query based on taxonomy terms. taxonomyThe taxonomy you would like to query tax_termThe term (or terms) you would like to include tax_operatorOperator to test. Possible values are ‘IN’, ‘NOT IN’, […]
Display Posts lets you easily display posts based on any criteria you choose without any coding. It can be difficult to match your theme’s design for post summaries using just the shortcode and CSS. That’s where template parts come in. Styling belongs in a theme Your theme already contains the markup and styling for displaying posts. […]