This shortcode is available in Shortcodes Ultimate Pro
Posts Grid is a Shortcodes Ultimate Pro shortcode for displaying WordPress posts in a responsive grid or list. It lets you filter posts by post type, taxonomy, terms, authors, keyword, and post IDs, and provides controls for the post card layout: featured image, title, meta fields, excerpt, read more link, and pagination.
| Attribute | Generator tab | Description | Values / format | Default |
|---|---|---|---|---|
post_type | Query | Filters posts by post type. | Registered post type slug. Comma-separated values are accepted by the runtime. | post |
taxonomy | Query | Limits results to posts associated with a taxonomy. | Registered taxonomy slug, or any to disable taxonomy filtering. | any |
terms | Query | Selects taxonomy terms used by the taxonomy filter. | Term IDs or slugs, comma-separated. Used only when taxonomy is set. | Empty |
operator | Query | Controls how selected taxonomy terms are matched. | IN, NOT IN, AND | IN |
include | Query | Includes only selected posts. | Post IDs, comma-separated. | Empty |
exclude | Query | Excludes selected posts. | Post IDs, comma-separated. | Empty |
author | Query | Limits results to selected authors. | User IDs, comma-separated. | Empty |
keyword | Query | Filters posts by a search keyword. | Plain text search string. | Empty |
posts_per_page | Query | Sets the number of posts shown per page. | Integer from -1 to 10000; -1 shows all posts. Invalid values fall back to 6. | 6 |
paged | Query, hidden | Sets the initial page number. Deep-link pagination can override it from the URL. | Integer from 1 to 10000. | 1 |
orderby | Query | Sorts retrieved posts by a WordPress query field. | none, id, author, title, name, date, modified, parent, rand, comment_count, menu_order, meta_value, meta_value_num, post__in | date |
order | Query | Sets ascending or descending sort order. | DESC, ASC | DESC |
ignore_sticky | Query | Ignores sticky posts when set to yes. | Boolean | yes |
layout | Layout | Selects the Posts Grid layout. | grid, list | grid |
grid_columns | Layout | Sets the number of columns on desktop screens. | Integer from 1 to 12. Invalid values fall back to 3. | 3 |
grid_tablet_columns | Layout | Sets the number of columns on tablet screens. | Integer from 1 to 12. Invalid values fall back to 2. | 2 |
grid_mobile_columns | Layout | Sets the number of columns on mobile screens. | Integer from 1 to 12. Invalid values fall back to 1. | 1 |
list_thumbnail_max_width | Layout | Sets the maximum featured image width for list layout. | Pixels, integer from 20 to 1200. Invalid values fall back to 300. | 300 |
horizontal_gap | Layout | Sets horizontal gap in pixels. In list layout, this controls the gap between the thumbnail and title. | Pixels, integer 0 or greater. | 24 |
vertical_gap | Layout | Sets vertical gap in pixels. In list layout, this controls the gap between list items. | Pixels, integer 0 or greater. | 24 |
skin | Layout, hidden | Selects the Posts Grid skin. | CSS class-safe skin slug. Currently registered value: default. | default |
accent_color | Single Post | Sets accent color for post title links, meta links, and pagination. | CSS color value accepted by su_sanitize_css_color(). | #0088ff |
show_image | Single Post | Shows the featured image. | Boolean | yes |
image_size | Single Post | Selects featured image size. | full or any registered WordPress intermediate image size. | medium_large |
image_ratio | Single Post | Sets featured image aspect ratio. | 21:9, 16:9, 16:10, 5:4, 4:3, 3:2, 2:1, 1:1, 1:2, 2:3, 3:4, 4:5, 10:16, 9:16, 9:21, or a numeric ratio. | 16:9 |
image_border_radius | Single Post | Sets featured image border radius. | Pixels, integer 0 or greater. | 5 |
show_title | Single Post | Shows the post title. | Boolean | yes |
title_tag | Single Post | Sets the HTML tag used for post titles. | h2, h3, h4, h5, h6 | h3 |
title_text_size | Single Post | Sets post title text size. 0 uses the default size. | Pixels, integer from 0 to 120. Invalid values fall back to 0. | 0 |
show_meta | Single Post | Shows post meta. | Boolean | yes |
meta_fields | Single Post | Selects meta fields and their order. | Comma-separated list. Generator values: date, category, author, comments. Runtime also renders modified. | date, category |
show_excerpt | Single Post | Shows the post excerpt. | Boolean | yes |
excerpt_length | Single Post | Sets the maximum number of words in the excerpt. | Integer 0 or greater. | 18 |
show_read_more | Single Post | Shows the read more link. | Boolean | no |
read_more_text | Single Post | Sets read more link text. | Plain text. | Read more... |
pagination | Advanced | Controls pagination mode. | none, ajax-numbers, ajax-prev-next, deep-links-numbers, deep-links-prev-next | ajax-numbers |
open_links_in_new_tab | Advanced | Opens post links in a new browser tab. | Boolean | no |
empty_text | Advanced | Sets text shown when no posts are found. | Plain text. | No posts |
class | Advanced | Adds extra CSS class names to the wrapper. | Space-separated CSS class names. | Empty |