- This topic has 5 replies, 3 voices, and was last updated 7 years, 10 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
Support › Forums › Flex Theme › Slider on page not in a widget
Is it possible to add the slider to a page rather than as a widget? My home page is a static page.
Many thanks.
Where are you wanting to put the slider ( at top or bottom of the page )? Can you share your site URL?
At the top of the page. As this is a site under development I would rather not share the URL if possible.
Many thanks
1. Install this plugin – https://wordpress.org/plugins/widget-shortcode/
2. Create the slider and add slider widget to the Arbitrary section (created by the above plugin) found in “widgets” section of the dashboard.
3. On saving the slider widget, it will generate a shortocde.
4. Use that shortcode in the page to display slider.
Here is the another approach. You will add the following code in functions.php file.
Code is for box-slider:
/* Slider on Static Page */
add_action( 'genesis_after_header', 'flex_slider_static_page' );
function flex_slider_static_page() {
if( is_front_page() ) {
$args = array (
'limit' => 5,
'type' => 'box-slider',
'animation' => 'fade',
'slideshowSpeed' => 7000,
'animationSpeed' => 1200,
'pagination' => 1
);
the_widget( 'Flex_Slider', $args );
}
}
Code for full width slider:
/* Slider on Static Page */
add_action( 'genesis_after_header', 'flex_slider_static_page' );
function flex_slider_static_page() {
if( is_front_page() ) {
$args = array (
'limit' => 5,
'type' => 'full-width',
'animation' => 'fade',
'slideshowSpeed' => 7000,
'animationSpeed' => 1200,
'pagination' => 1
);
the_widget( 'Flex_Slider', $args );
}
}
You can change the value of args array as per your requirement.
Thank you adding the code to the functions file worked.