Display Posts includes many Display Parameters for customizing what is shown for each post in the list. It does not include an option for listing the comment count, but you can add one yourself using the Output Filter. Once the code below has been added to your site, you can include the comments link like […]
The links in Display Posts all open in the current window. We can use the output filter to modify this, making all links open in a new window:
This is available as a separate plugin: Display Posts – Transient Cache Some users will build very complex queries involving multiple taxonomy and meta queries. These can be computationally expensive to run, and running the query on every uncached pageload is not necessary. We can store the output of the shortcode in a transient – […]
There are a few ways you can exclude posts in certain categories from your listings. By Category ID By default, the category_id parameter limits results to posts IN these categories. For instance, displays posts in the category with an ID of 123. You can use negative numbers to exclude categories. If you want posts in […]
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 […]