• Home
  • Blog
  • Showcase
  • Setup Docs
    • Sunshine Help
    • Flex Help
  • Support
    • Support Area
    • Contact us
    • Feedback
  • Connect
    • Newsletter
    • Twitter
    • Facebook
  • My Account
  • Flex
  • Sunshine
Support : Simple Pro Themes

Support : Simple Pro Themes

[Resolved] Slider on page not in a widget

If you have purchased a product, please enter the email address that you used to register at time of purchase.
Log In
Lost Password

Create an Account
  • Your username must be unique, and cannot be changed later.
  • We use your email address to email you a secure password and verify your account.

Support › Forums › Flex Theme › Slider on page not in a widget

  • This topic has 5 replies, 3 voices, and was last updated 5 years, 5 months ago by NickyP.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • August 12, 2015 at 9:18 am #476
    NickyP
    Participant

    Is it possible to add the slider to a page rather than as a widget? My home page is a static page.

    Many thanks.

    August 12, 2015 at 11:09 am #477
    Chinmoy Paul
    Moderator

    Where are you wanting to put the slider ( at top or bottom of the page )? Can you share your site URL?

    August 12, 2015 at 11:19 am #478
    NickyP
    Participant

    At the top of the page. As this is a site under development I would rather not share the URL if possible.

    Many thanks

    August 12, 2015 at 11:32 am #479
    Davinder Singh Kanith
    Moderator

    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.

    August 12, 2015 at 11:51 am #480
    Chinmoy Paul
    Moderator

    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.

    August 12, 2015 at 4:52 pm #485
    NickyP
    Participant

    Thank you adding the code to the functions file worked.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Copyright © 2021 · Simple PRO Themes for Genesis Framework · About · FAQs · Contact · Affiliates