Shortcodes & Hardcodes for displaying a Slideshow
There’s several ways of displaying a Slideshow Gallery on your site.
Note: The legacy shortcode [slideshow] and the present shortcode [tribulant_slideshow] are interchangeable aliases for the same handler. Legacy content can keep using [slideshow] but for any new embeds, use [tribulant_slideshow]. We recommend modifying all legacy shortcodes to the new one.
Shortcode for all slides
To embed a slideshow with all slides under Slideshow > Manage Slides in the plugin, simply insert the shortcode below into the content of a post/page.
[tribulant_slideshow]
Shortcode for Featured Posts
You can create a slideshow from featured posts, each post being a slide and it’s featured image used as the slide image. The link of the slide will be the link of the post so clicking on the slide will take users to that post.
Here is a sample shortcode that you can use for this:
[tribulant_slideshow featured="true" featurednumber="10" featuredtype="post"]
Shortcode for gallery’s slides
To embed a slideshow with slides from a specific gallery under Slideshow > Manage Galleries in the plugin, simply insert the shortcode below (where X is the ID value of the gallery) into the content of a post/page.
[tribulant_slideshow gallery_id="X"]
Shortcode for the images of a WordPress post/page
To embed a slideshow with the images uploaded to a WordPress post/page through it’s media gallery, simply insert the shortcode below (where X is the ID value of the post). Whether you want to display the images from a post or a page, the parameter remains post_id.
[tribulant_slideshow post_id="X"]
Shortcode for latest/featured products
In order to display latest or featured products in a slideshow, you need the Shopping Cart plugin from Tribulant Software. Once you have this installed and activated, you can easily display recent or featured products. To display recent products use the shortcode below.
[tribulant_slideshow products="latest"]
And to display featured products, use the one below.
[tribulant_slideshow products="featured"]
For both, you can use the productsnumber parameter to limit the number of products eg.
[tribulant_slideshow products="latest" productsnumber="5"]
Shortcode for information heading
To set the information heading of a slide to title, use the following shortcode:
[tribulant_slideshow infoheadingcontent="title"]
To set the information heading of a slide to caption, use the following shortcode: [tribulant_slideshow infoheadingcontent="caption"]
Hardcode it into any plugin/theme with PHP
To hardcode into any PHP file of your WordPress theme, simply use
<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>
Parameters for shortcode/hardcode to customize each slideshow
You can use any of the following parameters with both the hardcoding and shortcode to customize each slideshow gallery:
Shortcode Ex 1:
[tribulant_slideshow layout="responsive" gallery_id="3" auto="true" navopacity="0" showthumbs="true"]
Shortcode Ex 2:
[tribulant_slideshow layout="specific" post_id="379" width="600" height="300" auto="false" showinfo="false"]
Hardcode Ex 1:
<?php slideshow(true, 3, false, array('layout' => "responsive", 'auto' => "true", 'navopacity' => "0", 'showthumbs' => "true")); ?>
Hardcode Ex 2:
<?php slideshow(true, false, 379, array('layout' => "specific", 'width' => "600", 'height' => "300", 'auto' => "false", 'showinfo' => "false")); ?>
This way you can customize each slideshow you embed or hardcode, despite the settings you saved under Slideshow > Configuration.
effect[ fade | slide ] = Choose the transition effect of the slideshow. Reference Configuration settings for all effects.slide_direction[ lr | tb ] = If you’re usingslidefor theeffect, you can choose left/right or top/bottom sliding.easing[ swing ] = Choose the easing effect you’d like. Reference Configuration settings for all effects.products[ latest | featured ] = Stringlatestorfeaturedto display products from our WP Checkout plugin.productsnumber[ productsnumber ] = Numeric/integer to limit the number of products to display.featured[ true | false ] = Show posts with their featured images.featurednumber[ number ] = A numeric/integer value. The default is 10.featuredtype[ post_type ] = A post type slug like ‘post’, ‘page’, etc. The default is ‘post’.gallery_id[ gallery_id ] = Numeric/integer ID of a gallery to display images from.post_id[ post_id ] = Numeric/integer ID of a post to take images from it, uploaded through its “Add Media” button.exclude[ attachment_id(s) | slide_id(s) ] = Comma-separated values identifying which entries to hide. This attribute only works when the shortcode loads custom slides or post attachments, and each source expects a different value type. Use slide IDs when loading custom slides and the 1-based attachment order when loading post attachments; galleries, featured posts, and other datasources ignore this attribute.
Example: If post 123 has three attachments ordered A,B,C, then[tribulant_slideshow post_id="123" exclude="2,3"]hides the second and third attachments (B,C) even though its database ID might be 987.numberposts[ numberposts ] = Numeric value of the number of images to take from the post/page. “-1” for unlimited/all.layout[ responsive | specific ] = Set to ‘responsive’ for mobile/tablet compatible theme and ‘specific’ for fixed width/height.resizeimages[ true | false ] = Set to ‘true’ to resize images to fit the slideshow dimensions.imagesoverlay[ true | false ] (default: setting) = Set to ‘true’ to display links of slides that are images in a Colorbox overlay on the page.orderby[ random ] = Set to ‘random’ to randomly order the slides. Leave this shortcode parameter to order by the order set on the slides.orderf[ id, date, name, type, created, order, menu_order ] = Choose the field to sort by. Leave this shortcode parameter to order by the order set on the slides.
Valid arguments:
Featured: id, menu_order
Posts: id, menu_order
Products: id, created, order, type
Gallery (gallery_id): order, id, created
All slides / custom: id, created, orderorderd[ asc | desc ] = Set the sort direction of the slides. Use ‘DESC’ for descending or ‘ASC’ for ascending. Leave this shortcode parameter to order by the order set on the slides.width[ width | auto ] = (only withlayout="specific") Width of the slideshow in pixels. Don’t specify ‘px’ part, just the numeric value for the height.resheight[ resheight ] = (only withlayout="responsive") Numeric/integer value such as “30” to be used with ‘resheighttype’ below.resheighttype[ resheighttype ] = (only withlayout="responsive") “px” (pixels) or “%” (percent) as the value eg. resheighttype=”%”.height[ height ] (only withlayout="specific"; default: setting) = Height of the slideshow in pixels. Don’t specify the ‘px’ part, just the numeric value for the height.autoheight[ true | false ] = Should the gallery adjust it’s height for each slide?autoheight_max[ pixels | false ] = Maximum height (in pixels) thatautoheight="true"can reach on the specific/fixed layout (layout="specific"). Set to false to remove the cap entirely.
Example:[tribulant_slideshow layout="specific" autoheight="true" autoheight_max="600"]prevents tall images from exceeding 600 px while still shrinking shorter ones automatically.auto[ true | false ] (default: setting) = Set this to ‘true’ to automatically slide the slides in the slideshow.alwaysauto[ true | false ] = When true, autoplay restarts after the visitor clicks navigation arrows, swipes, or uses the keyboard. When false, any manual interaction pauses autoplay for the rest of the page view.
Example:[tribulant_slideshow auto="true" alwaysauto="false"]starts in auto mode but stops moving once the user clicks next/prev.autospeed[ speed ] (default: setting) = Speed of the auto sliding. 10 is normal. Lower number is faster. Between 5 and 15 is recommended.fadespeed[ speed ] (default: setting) = Speed of the fading of images. 10 is normal. Lower number is faster. Between 1 and 20 is recommended.shownav[ true | false ] (default: setting) = Set to ‘true’ to show the next/previous image navigation buttons.navopacity[ opacity ] (default: setting) = The opacity of the next/previous buttons. Between 0 and 100 with 0 being transparent and 100 being fully opaque.navhoveropacity[ opacity ] (default: setting) = The opacity of the next/previous buttons on hovering. Between 0 and 100 with 0 being transparent and 100 being fully opaque.showinfo[ true | false ] (default: setting) = Set to ‘true’ to show the information bar for each slide.infospeed[ speed ] (default: setting) = Speed at which the information bar will slide up. Between 5 and 15 is recommended.infoonhover[ true | false ] = Show the info bar only while the cursor hovers over the slideshow container. Set to false to keep captions visible at all times.
Example:[tribulant_slideshow infoonhover="1"]keeps the info strip hidden until the user hovers, while[tribulant_slideshow
infoonhover="0"]displays it automatically.infodelay[ seconds ] = Delay before expanding the info bar/strip wheninfoonhover="false". Use 0 for an immediate caption reveal.
Example:[tribulant_slideshow infoonhover="0" infodelay="2"]waits two seconds before revealing captions.infofade[ true | false ] = Automatically hide the info bar/strip after it opens. Useinfofadedelay[ seconds ] to specify how long to wait before starting the hide animation wheninfofade="true".
Example:[tribulant_slideshow infoonhover="0" infofade="1" infofadedelay="4"]shows the info panel automatically, then collapses it four seconds later.showthumbs[ true | false ] (default: setting) = Set to ‘true’ to show the thumbnails for the slides.thumbsposition[ top | bottom ] (default: setting) = Set to “top” to show above the slideshow.thumbsborder[ hexidecimal color ] (default: setting) = Hex color of the active thumb border. For example: #333333.thumbsspeed[ speed> ] (default: setting) = Speed of the thumbnail bar scrolling. Lower is slower. Between 1 and 20 is recommended.thumbsspacing[ spacing ] (default: setting) = An integer value in pixels to space the thumbnails apart. Don’t include the ‘px’ part, just the number. Between 0 and 10 is recommended.custom[ true | false ] = Force the slideshow to fetch slides from Manage Slides (equivalent to leavingpost_idempty) (even ifgallery_idorpost_idis set). Combine withexcludeto omit specific slide IDs.
Example:[tribulant_slideshow custom="1" exclude="15,18"]loads all slides and removes IDs 15 and 18.
Earn Money by Referring People
Refer customers to us with your affiliate link and earn commission on sales from your link.
