Here’s a WordPress plugin that will allow you to create a slideshow from posts – using either the provided “Heroes” content type or any other post type. Added bonus – you can place the slideshow anywhere with a shortcode.
Download ABT Featured Heroes Download from WordPress
As taken from the
Provides a new content type “Heroes” to manage your featured slides. You can then add a slideshow to any page using the shortcode
abt_slider_hero. The slideshow is automatically configured using jQuery Cycle and the options you specify in the shortcode.
One of the options
postType allows you to use other content than the provided “Heroes”, effectively allowing a slideshow of almost anything in WordPress.
- Unzip, upload plugin folder to your plugins directory (
- Activate plugin
- Add slideshow shortcode anywhere you need it.
- If you want to put the widget (shortcode) in a Widget, you’ll need to allow shortcodes in widgets
- You can call the slideshow in code using
abt_featured_heroes::embed( array $atts )
Frequently Asked Questions
What is the shortcode?
Use the following format (defaults indicated here):
[abt_slider_hero fx="fade" width="100%" height="400px" order="asc" orderby="menu_order" speed="600" timeout="7000" classes="" postType="heroes" style="photo"]
- fx = the cycle transition effect (fade, scrollUp, shuffle, etc) – see jQuery Cycle homepage for more information
- width = width of the slide
- height = height of the slide
- order = sorting order (asc/desc) for the fetched items
- orderby = how to sort the fetched items
- speed = transition speed from one slide to the next
- timeout = delay between slide changes
- classes = optional classes to apply to the slideshow
- postType = you can retrieve other content types than “heroes” if desired
- style = normally the thumbnail navigation just reuses the full-size image, but if you want to “control” the quality of the shrunken thumb specify an alternate image size (like “thumbnail”)
Pretty much all of the attributes are optional, so all you need is:
How do I put a slideshow in code?
You can call the slideshow in code using
abt_featured_heroes::embed( array $atts ), where
$atts is an array matching the shortcode attribute list.
Can I change the defaults?
Only one simple hook available:
stylesheet: replace the default stylesheet with your own to change the default appearance of slides
speed: change the transition speed (from 600 ms)
timeout: change the slide delay (from 7000 ms)
fx: change the slide transition (from ‘fade’)
style: optionally use actual thumbnail photos for navigation, instead of reusing full-size images (default ‘photo’, alt ‘thumbnail’)
width: default width (from 100%)
height: default height (from 400px)
How to put shortcode in widget?
Use a filter to apply shortcode processing to widgets.
<?php add_filter('widget_text', 'do_shortcode'); ?>