开发者 |
halgatewood
ghuger richardgabriel |
---|---|
更新时间 | 2021年3月31日 02:30 |
捐献地址: | 去捐款 |
PHP版本: | 3.6 及以上 |
WordPress版本: | 5.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
/wp-content/plugins/
directoryif(function_exists('show_flexslider_rotator')) echo show_flexslider_rotator( 'homepage' );
The size of the rotator is set from your WordPress Image Size settings. You can set those with the following function (also in your functions.php file).
add_image_size( 'homepage-rotator', '550', '250', true );
For the rotator itself it uses FlexSlider by WooThemes. To setup custom options like making the rotator slide, you can add FlexSlider options. The below example shows how and all the options can be found at http://www.woothemes.com/FlexSlider/
$rotators['homepage'] = array( 'size' => 'homepage-rotator', 'options' => "{slideshowSpeed: 7000, direction: 'vertical', animation: 'slide'}" );
To include the rotator in your theme include the 'slug' found from your function above ($rotators['homepage']) and add the following line to your template:
if(function_exists('show_flexslider_rotator')) echo show_flexslider_rotator( 'homepage' );
You can also use the new shortcode [flexslider slug="homepage"] to include the rotator in certain posts, pages, widgets, etc.
New in version 1.3: If you want to display the image attachments for a give post or page simply add the shortcode [flexslider] and it will automatically grab the images. You can click the standard 'Add Media' button above the WordPress Content Editor and then reorder the images to the order you want them to display. Used to be called: Responsive Slider for Developers