If there are no shortcode tags defined, then the content will be returned without any filtering. String Content with shortcodes filtered out. How to query the terms (IN, NOT IN, or AND)ĭescribe the relationship between the multiple taxonomy queries (should the results match all the queries or just one of them).When true, shortcodes inside HTML elements will be skipped. Which terms to include (if more than one, separate with commas) In the field listing below, replace (count) with an actual number. You can string as many of those as you like, start the count at 2. If you wanted to get all posts in the category “featured” that are also tagged either “blue” or “green”, you could use a shortcode that looks like this: We’ll use a shortcode that looks like this: Let’s say you wanted to get all posts in the category “featured” and also tagged “homepage”. While most people will only ever need a single taxonomy query, this shortcode supports an infinite number of taxonomy queries. It can be an unordered list (ul), ordered list (ol), or divs (div) which you can then style yourself. What type of HTML should be used to display the listings. 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).ĭefault: ‘taxonomy’ = empty, ‘tax_term’ = empty, ‘tax_operator’ = ‘IN’ Use these parameters to do advanced taxonomy queries. Specify the tag slug (or comma separated list of tag slugs) Similarly, for Testimonials use “jetpack-testimonial”. You can use a default one (post or page). Show posts associated with a certain post status You can either specify an ID or ‘current’, which displays the children of the current page. If you are using the Portfolio post type, use this to get items from a specific portfolio type.ĭisplay the pages that are a child of a certain page. Specify whether posts are ordered in descending order (DESC) or ascending order (ASC). Include the post’s excerpt after the title (and date if provided). The default format is (7/30/12), but this can be customized using the ‘date_format’ parameter. Include the post’s date after the post title. Include the full post content after the title. If you’re using a theme that supports Content Options, and have it set to not show featured images on Pages, the image_size argument will also have no effect on shortcodes used on a page on the site – featured images will not show for any posts added via the shortcode even if the shortcode says they should be shown. The image_size can be set to thumbnail, medium, large (all controlled from Settings > Media). Specify an image size for displaying the featured image, if the post has one. Specify a specific post ID (or multiple post IDs) to display. See Formatting Date and Time on the Codex for more information. Specify the date format used when include_date is true. View this shortcode in action on this example site.Įxample: Specify the category slug (or comma separated list of category slugs). Below is a list of common arguments you can add to your Display Posts shortcode and examples of how the shortcode should look with the argument added. Arguments are used to customize how the posts are displayed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |