Below are roughly 32 [shortcodes] to use in your WordPress website.  These shortcodes work with Premium & Free WordPress websites.  Thanks to WordPress, they are below and can also be located here.


Display Posts Shortcode

The Display Posts Shortcode allows you to fine-tune the posts you wish to display on a page.

Add the shortcode

in a post or page, and use the arguments to query based on tag, category, post type, and many other possibilities.

New posts will be displayed within one hour of publishing.

Examples

This will list the 20 most recent posts with the tag ‘Advanced’.

This will list the 10 most recent posts tagged ‘Advanced’ and display a post image using the ‘Thumbnail’ size.

This will list every post in the Must Read category, in alphabetical order, with the date appended to the end.

  1. 20 Google Search Tips to Use Google More Efficiently
  2. Defining different color uses: HEX – CMYK – PMS – RGBRetrieved from: Neglia Design
  3. borislavkiprin: The Complete Guide to Snapchat Ad Targeting…
  4. How to Name Images for SEO in SecondsHow to Name Images for SEO in Seconds [WordPress Websites]
  5. Web Ads
  6. Tumblr URL Searching
  7. borislavkiprin:How to Optimize Your YouTube Channel #Infographic
  8. borislavkiprin:This Is What Happens In an Internet Minute in…
  9. Learn how to create, manage, and edit hyperlinks in InDesignHyperlinks how to in InDesign by Adobe!…
  10. Social Media Colors for 2018: HEX Codes, RGB, SASSHex Codes + RGB

This will display posts as an ordered list. Options are ul for unordered lists (default), ol for ordered lists, or div for divs.

This will display only the posts with an ID of 14 and 3.

↑ Table of Contents ↑

↑ Table of Contents ↑

Arguments

author
Specify the post author
Default: empty
Example:

category
Specify the category slug (or comma separated list of category slugs)
Default: empty
Example:

date_format
Specify the date format used when include_date is true. See Formatting Date and Time on the Codex for more information.
Default: ‘(n/j/Y)’
Example:

id
Specify a specific post ID (or multiple post IDs) to display.
Default: empty
Example:

image_size
Specify an image size for displaying the featured image, if the post has one. The image_size can be set to thumbnail, medium, large (all controlled from Settings > Media).
Default: empty
Example:

include_content
Include the full post content after the title.
Default: empty
Example:

include_date
Include the post’s date after the post title. The default format is (7/30/12), but this can be customized using the ‘date_format’ parameter.
Default: empty
Example

include_excerpt
Include the post’s excerpt after the title (and date if provided).
Default: empty
Example:

offset
The number of posts to pass over
Default: 0
Example:

order
Specify whether posts are ordered in descending order (DESC) or ascending order (ASC).
Default: DESC
Example:

orderby
Specify what the posts are ordered by. See the available parameters here.
Default: date
Example:

portfolio_type
If you are using the Portfolio post type, use this to get items from a specific portfolio type.

post_parent
Display the pages that are a child of a certain page. You can either specify an ID or ‘current’, which displays the children of the current page.
Default: empty
Example:

post_status
Show posts associated with a certain post status
Default: publish
Example:

post_type
Specify which post type to use. You can use a default one (post or page). For Portfolios use “jetpack-portfolio”.  Similarly, for Testimonials use “jetpack-testimonial”.
Default: post
Example:

posts_per_page
How many posts to display.
Default: 10
Example:

tag
Specify the tag slug (or comma separated list of tag slugs)
Default: empty
Example:

taxonomy, tax_term, and tax_operator
Use these parameters to do advanced taxonomy queries. Use ‘taxonomy’ for the taxonomy you’d like to query, ‘tax_term’ for the term slug (or terms) you’d like to include, and ‘operator’ to change how the query uses those terms (most likely this field will not be needed).
Default: ‘taxonomy’ = empty , ‘tax_term’ = empty , ‘tax_operator’ = ‘IN’
Example:

wrapper
What type of HTML should be used to display the listings. It can be an unordered list (ul), ordered list (ol), or divs (div) which you can then style yourself.
Default: ul
Example:

  1. 20 Google Search Tips to Use Google More Efficiently
  2. Defining different color uses: HEX – CMYK – PMS – RGBRetrieved from: Neglia Design
  3. borislavkiprin: The Complete Guide to Snapchat Ad Targeting…
  4. How to Name Images for SEO in SecondsHow to Name Images for SEO in Seconds [WordPress Websites]
  5. Web Ads
  6. Tumblr URL Searching
  7. borislavkiprin:How to Optimize Your YouTube Channel #Infographic
  8. borislavkiprin:This Is What Happens In an Internet Minute in…
  9. Learn how to create, manage, and edit hyperlinks in InDesignHyperlinks how to in InDesign by Adobe!…
  10. Social Media Colors for 2018: HEX Codes, RGB, SASSHex Codes + RGB

↑ Table of Contents ↑

Multiple Taxonomy Queries

While most people will only ever need a single taxonomy query, this shortcode supports an infinite number of taxonomy queries. Let’s say you wanted to get all posts in category “featured” and also tagged “homepage”. We’ll use a shortcode that looks like this:

You can string as many of those as you like, just start the count at 2. In the field listing below, replace (count) with an actual number.

Here’s the available fields:

taxonomy_(count)
Which taxonomy to query
Default: empty

tax_(count)_term
Which terms to include (if more than one, separate with commas)
Default: empty

tax_(count)_operator
How to query the terms (IN, NOT IN, or AND)
Default: IN

tax_relation
Describe the relationship between the multiple taxonomy queries (should the results match all the queries or just one of them). Available options: AND and OR
Default: AND

↑ Table of Contents ↑

Image Alignment

A common request is display a list of posts with title, excerpt, and the thumbnail aligned to the right. Here’s the shortcode you might use:

20 Google Search Tips to Use Google More Efficiently - 20 Google Search Tips to Use Google More Efficiently
Defining different color uses: HEX – CMYK – PMS – RGBRetrieved from: Neglia Design - Defining different color uses: HEX – CMYK – PMS – RGB Retrieved from: Neglia Design
borislavkiprin: The Complete Guide to Snapchat Ad Targeting… - borislavkiprin: The Complete Guide to Snapchat Ad Targeting #Infographic
How to Name Images for SEO in SecondsHow to Name Images for SEO in Seconds [WordPress Websites] - How to Name Images for SEO in Seconds How to Name Images for SEO in Seconds [WordPress Websites]
Web Ads - Web Ads
Tumblr URL Searching - Tagged: cheezbag.tumblr.com/tagged/<tag> Shows all the posts on a blog that have been tagged with that tag. Works on any blog. Well, any blog that uses tags. Chrono: cheezbag.tumblr.com/tagged/<tag>/chrono Variation on a theme: orders posts with a particular tag in chronological order.
borislavkiprin:How to Optimize Your YouTube Channel #Infographic - borislavkiprin: How to Optimize Your YouTube Channel #Infographic
borislavkiprin:This Is What Happens In an Internet Minute in… - borislavkiprin: This Is What Happens In an Internet Minute in 2018 #infographic
Learn how to create, manage, and edit hyperlinks in InDesignHyperlinks how to in InDesign by Adobe!… - Learn how to create, manage, and edit hyperlinks in InDesign Hyperlinks how to in InDesign by Adobe! Here’s the link: https://helpx.adobe.com/indesign/using/hyperlinks.html
Social Media Colors for 2018: HEX Codes, RGB, SASSHex Codes + RGB - Social Media Colors for 2018: HEX Codes, RGB, SASS Hex Codes + RGB

This includes the excerpt, adds an image of the “thumbnail” size (you can customize the image sizes in Settings > Media), and tells it to present the list without bullets.

In order to get the image floating to the right, add this to your custom CSS file (requires the WordPress.com Premium or WordPress.com Business upgrade):

.display-posts-listing .alignleft {
    float: right;
    margin: 0 0 5px 5px;
}

↑ Table of Contents ↑

Limits

The Display Posts Shortcode has a limit of 100 posts displayed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s