Go To ↓ Navigation & Information Other Information

Using the List Posts Shortcode

Another useful shortcode is used to list posts on any page or post. This can make a list of news stories or articles appear in any place on your WordPress website.

[list-posts posts_per_page=2]

This simplest usage above will display a list of the two most resent posts published for your website with the date.

[list-posts posts_per_page=2 qs_content=100 qs_thumbnail='100x50' qs_container_class='list-posts-nicholls-news' qs_template='%title% { %content% %thumbnail% }']

This example has various advanced options to do thumbnails and format the output.

  • On January 14th, 2013 we had a casual meeting with many of our department website editors, the university Website Manager, and staff from the Office of University Relations. The two main topics discussed were about the recent Nicholls Website redesign and changes introduced during the recent WordPress 3.5 upgrade. To give more information for meeting attendees and editors that were unable to attend two articles have been written about our meeting topics. WordPress 3.5 Media Management 2012 Nicholls Website Redesign New Theme Information Be sure to check out the Website Editor Checklist & Notes for useful information about maintaining content…...
  • The Nicholls website has been redesigned with a new look based on several months of work and discussion. Although these changes are numerous and affect the website in dramatic ways, the fundamental content of most Nicholls websites should display as before with a new altered look. There are only a few areas that department website editors should be aware of. New header images - Department websites now have the option of selecting from several photos that can be used for the large header image displayed at the top of all pages on a departmental website. Additionally, a custom header can…...
[list-posts qs_title_tag='h4' posts_per_page=10 qs_content=240 qs_thumbnail='100' qs_container_class='list-posts-nicholls-news']

The list posts shortcode only has a couple of attributes to manipulate the display of the posts.

  • qs_title_tag – The tag used around the title of each post (default is DIV).
  • qs_more – Can be used so the more separator can be used to create a a lead in (experimental).
  • qs_content -Used to set the number of characters to display below the date.
  • qs_thumbnail -Used to set whether to use the featured image of the post as the thumbnail (default is 0). Thumbnail size can be indicated using number height and width like 120 or 100×150 or using a predefined thumbnail size name like medium.
  • qs_container_style – Can be used to override the styles using a style attribute on the container.
  • qs_container_class – Can be used to set an HTML CSS class on the container.
  • qs_template – Can be used to set the layout and ordering for the elements in each post item. { = <div>, } = </div> and use terms %title%, %date%, %thumbnail%, %content%. Default is “%title% %date% %thumbnail% %content%”
  • posts_per_page – Sets the number of posts to display (default is -1 all posts).
  • tag – Can be set to display posts having specified tags. Multiple tags can be separated by commas.
  • cat -Can be set to display posts in specified categories. Multiple categories can be separated by commas.
  • category_name – Can display posts specified by one category name.
Go To ↑ Top