If your website has an active following on social media, you can use social share counts to determine your most popular content. First, you need to use a social sharing plugin that stores your share counts in WordPress. I recommend Shared Counts – the best social sharing plugin on the market. Find out what meta […]
Display Posts lets you limit posts to a certain category with the category parameter. But what if you’d like to show other posts in the current post’s category without having to type it out each time. This is especially useful in widgets and sidebars since you can add the shortcode once and it will automatically update to […]
Display Posts includes a parameter for displaying the post date: Shortcode Result Date Format You can customize the date format to any format you like (see Formatting Date and Time). For instance, this will include the time along with the date: Shortcode Result Customize text around date and time If you’d like to customize the […]
If you include the image_size parameter, Display Posts will add an image below the post title. The snippet below lets you make the image appear before the post title instead.
You can use Display Posts to list upcoming events from The Events Calendar. After adding the code snippet below to your site, you can generate a list of upcoming events with:
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:
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: […]
The title parameter lets you define a title to appear above the post listing. This uses the <h2> element by default. You can use the display_posts_shortcode_title_tag filter to modify what heading is used. The code below changes this to an h4.
By default, Display Posts displays nothing if no posts were found matching your query. You can specify content to display using the no_posts_message parameter. Using a filter You can also use the display_posts_shortcode_no_results filter to modify the no posts message. This is useful if you want to use the same message on all instances of […]
When using 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 […]