Shortcodes

Most properties can be set in the style sheet or in the custom CSS module for your theme. The following settings are shortcode settings that apply to individual grids. Note that for width and height values you may use any valid unit of height: px, cm, %, etc. Note: Media Image sizes are configured in the wordpress admin panel under Settings/Media. The default thumbnail size is 150px by 150px. The style sheet is configured to handle the default thumbnail size. To properly display your images, you must modify the height and witdth in the thumbanil shortcode or the style sheet.

Many of the parameters available in the WordPress Codex can be used in the shortcode, with a few exceptions.

All settings default to empty, null or false except for the following (be aware that this may have changed from previous versions)
‘post_type’ = ‘post’
‘showcaption’ = true
‘imagesize’ =’thumbnail’

‘posts_per_page’ = -1

Grid:

The width of the grid. this value defaults to the width of the grid area or to the setting in the style sheet.

maxgridwidth – as of ver. 5.3

Use max width instead of width with align to wrap the grid when the window resizes.

When the gridwidth value is set, set this value to left, right, center or autocenter (as of version 5.3). center may not work in all themes. autocenter uses jQuery to center the grid instead.

[thumbnailgrid maxgridwidth="700px" aligngrid="left" post_type="post" posts_per_page = "3" cat="4"]

[thumbnailgrid "maxgridwidth"="700px" "aligngrid"="right" "showcaptions"=true "post_type"="post" posts_per_page = "3" cat="4"]

[thumbnailgrid maxgridwidth="700px" aligngrid="center" post_type="post" posts_per_page = "3" cat="4"]

[thumbnailgrid aligngrid=""autocenter" cat="4" post_type="post" posts_per_page="3"]

Captions:

Set showcaption=FALSE to hide the captions showcaption defaults to TRUE

[thumbnailgrid showcaption=FALSE posts_per_page = "3" post_type="post" cat="1"]

This value sets the caption height and hides the overflow (if there is more text than can fit into the caption area, it will not be visible). The display defaults to one line of text or the value in the style sheet.

The caption width. This value defaults to the width variable above or to the setting in the style sheet.

Wrap the text in the caption. Normally the text is limited to one line and overflow is indicated by an elipses. Please note that, to avoid a misaligned grid, you should set a caption height when wrapping text in a grid that has more than one row. wraptext defaults to FALSE

[thumbnailgrid wraptext=TRUE captionheight="50px" posts_per_page = "3" post_type="post" cat="4"]

Thumbnail:

has_thumbnails 

When set to true, only thumbnails with images will be displayed in the grid.   This may not work when default images are used.

The height of thumbnail image. This value defaults to the height of the thumbnail or the setting in the style sheet.

width

The width of the thumbnail image. This value defaults to the width of the thumbnail or the setting in the style sheet. To display an image proportionately, set this value to ‘auto’;

[thumbnailgrid width="25px" height="25px" posts_per_page="3" post_type="post" cat="5"]

If you have images of different sizes, use a fixed height and set the width to auto to display your thumbnails proportionately.

[thumbnailgrid cat="1" posts_per_page="3" imagesize="medium" height="100px" post_type="post" width="auto"]

imagesize

Media Image sizes are configured in the wordpress admin panel under Settings/Media. You can use any size in the plugin. The default value is ‘thumb’. thumb thumbnail medium large post-thumbnail.

If you wish, you can display the posts at the appropriate size for the image.

[thumbnailgrid cat="4,5" posts_per_page="3" post_type="post" imagesize="medium" height="200px" width="200px"]

Posts:

Reminder: A page is a type of post. Use post_type to display thumbnails for pages or for custom posts.

[thumbnailgrid post_type="page"]

You can use the following parameters to restrict posts. All of these parameters take a comma delimited list of post (or page) id’s except for the tag_slug parameters.

author__in

display posts for specified author id’s

[thumbnailgrid post_type="post" author__in="1"]


author__not_in

Not currently working

category__and

displays posts who match all of the categories

[thumbnailgrid post_type="post" category__and="4, 5"]


category__in

displays posts that match any of the categories

[thumbnailgrid post_type="post" category__in="4, 5"]

[thumbnailgrid post_type="post" has_thumbnails='TRUE' category__not_in="4"]


tag__and

matches posts that have all of the matching tag id’s

[thumbnailgrid post_type="post" tag__and="6,7"]


tag__in

matches posts that have any of the matching tag id’s

[thumbnailgrid post_type="post" tag__in="6,7"]


tag__not_in

matches posts that do not match any of the tag id’s

[thumbnailgrid post_type="post" has_thumbnails='TRUE'  tag__not_in="7"]

tag_slug

includes posts with the specific tag slug

[thumbnailgrid post_type="post" tag_slug__and="demo-tag, another-demo-tag"]

tag_slug_in

excludes posts with a specific tag

[thumbnailgrid post_type="post" tag_slug__in=" another-demo-tag"]


post_parent__in

list specific  posts based on the parent, usually when the post type = ‘page’ 

[thumbnailgrid post_type="page" post_parent__in="208"]


post_parent__not_in

exclude specific posts based on the parent page, usually when the post type = ‘page’

thumbnailgrid post_type=”page”  post_parent__not_in=”208″ has_thumbnails=’TRUE’


post__in

include specific posts

 

[thumbnailgrid post_type="post" post__in="235, 204"]


post__not_in 

Exclude specific posts

[thumbnailgrid post_type="post" post__not_in="235, 204" has_thumbnails='TRUE']


Dates:

day, month, year

[thumbnailgrid month="6" year="2022" day="16" has_thumbnails='TRUE']


before, after, inclusive 
Set a date range using before & after. Set inclusive = true to include before & after in the query.

[thumbnailgrid before="June 16, 2022" inclusive=true has_thumbnails=true]

[thumbnailgrid after="June 15, 2022" has_thumbnails=true]

[thumbnailgrid before="June 30, 2022" after="June 10, 2022" has_thumbnails=true]

You may also use “today” in place of the date.

thumbnailgrid before=”today” inclusive=true has_thumbnails=true


Other:
debug_query

Setting debug_query to true can be used by advanced users to diagnose the query generated by this shortcode or for support purposes.

thumbnailgrid debug_query=true has_thumbnails=true