- This topic has 10 replies, 2 voices, and was last updated 9 years, 2 months ago by
Mahesh.
-
AuthorPosts
-
August 8, 2016 at 8:00 pm #96810
Rheja
ParticipantHello,
I really like the theme and all functions. But now I have a question about the featured image slider on my homepage.
I want the pictures to randomize everitime someone is opening that page. So the images will not show the same image first every time.
I want to use like 10 images and it would be great if sometimes the last is showing first and the first one is showing 5th.. etc
Is that possible (I Really hope)
My site is Rheja.com
Regards
jap
August 9, 2016 at 10:50 am #96859Mahesh
Participant@rheja:
Hi Jap,For this, you’ll need to create a child theme. You can find more on creating child theme HERE. Then in you child theme’s functions.php add the following codes:
function fullframe_featured_slider() { global $post, $wp_query; //fullframe_flush_transients(); // get data value from options $options = fullframe_get_theme_options(); $enableslider = $options['featured_slider_option']; $sliderselect = $options['featured_slider_type']; $imageloader = isset ( $options['featured_slider_image_loader'] ) ? $options['featured_slider_image_loader'] : 'true'; // Get Page ID outside Loop $page_id = $wp_query->get_queried_object_id(); // Front page displays in Reading Settings $page_on_front = get_option('page_on_front') ; $page_for_posts = get_option('page_for_posts'); if ( $enableslider == 'entire-site' || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && $enableslider == 'homepage' ) ) { if( ( !$fullframe_featured_slider = get_transient( 'fullframe_featured_slider' ) ) ) { echo '<!-- refreshing cache -->'; $fullframe_featured_slider = ' <section id="feature-slider"> <div class="wrapper"> <div class="cycle-slideshow" data-cycle-log="false" data-cycle-pause-on-hover="true" data-cycle-swipe="true" data-cycle-random="true" data-cycle-auto-height=container data-cycle-fx="'. esc_attr( $options['featured_slide_transition_effect'] ) .'" data-cycle-speed="'. esc_attr( $options['featured_slide_transition_length'] ) * 1000 .'" data-cycle-timeout="'. esc_attr( $options['featured_slide_transition_delay'] ) * 1000 .'" data-cycle-loader="'. esc_attr( $imageloader ) .'" data-cycle-slides="> article" > <!-- prev/next links --> <div class="cycle-prev"></div> <div class="cycle-next"></div> <!-- empty element for pager links --> <div class="cycle-pager"></div>'; // Select Slider if ( $sliderselect == 'demo-featured-slider' && function_exists( 'fullframe_demo_slider' ) ) { $fullframe_featured_slider .= fullframe_demo_slider( $options ); } else if ( $sliderselect == 'featured-post-slider' && function_exists( 'fullframe_post_slider' ) ) { $fullframe_featured_slider .= fullframe_post_slider( $options ); } elseif ( $sliderselect == 'featured-page-slider' && function_exists( 'fullframe_page_slider' ) ) { $fullframe_featured_slider .= fullframe_page_slider( $options ); } elseif ( $sliderselect == 'featured-category-slider' && function_exists( 'fullframe_category_slider' ) ) { $fullframe_featured_slider .= fullframe_category_slider( $options ); } elseif ( $sliderselect == 'featured-image-slider' && function_exists( 'fullframe_image_slider' ) ) { $fullframe_featured_slider .= fullframe_image_slider( $options ); } $fullframe_featured_slider .= ' </div><!-- .cycle-slideshow --> </div><!-- .wrapper --> </section><!-- #feature-slider -->'; set_transient( 'fullframe_featured_slider', $fullframe_featured_slider, 86940 ); } echo $fullframe_featured_slider; } }
Regards,
MaheshAugust 9, 2016 at 2:52 pm #96877Rheja
ParticipantOk,
I tried to make a child theme. But when I activate it my slider is dessapeared, my sidebars, menu’s and a lot of settings.
How can I make the childtheme exactly like my site is now?
Or when I change to the child theme .. do I have to re do all settings manual?
I hope you can point me out what files and folders I do have to copy in my child theme folder.
Thanks in advantage!
August 9, 2016 at 4:12 pm #96880Rheja
ParticipantOk, did the settings manual.
I copied the code into my functions. First it did not work.
After removing the endif; at the end it was working.
Do I need the endif?
thanks in advantage
August 9, 2016 at 4:53 pm #96881Mahesh
Participant@rheja: Sorry that was mistake while I copied, no you don’t need that. I’m glad that you found the issue and resolve is yourself.
If you use child theme, yes you’ll need to configure the settings again. Or may be use some plugins to do so.
Have a nice day!Regards,
MaheshAugust 9, 2016 at 5:09 pm #96883Rheja
ParticipantOk.. it is working..
One final question. After making a childtheme .. the slider text, promotional headlines, etc are not translated in English anymore.
I use polylang and without the childtheme it is working correct but with the childtheme it keeps in dutch.
Do you know how I can solve this?
jap
August 9, 2016 at 5:12 pm #96885Rheja
ParticipantOk skip that last question. Thanks for your help
I see there is another problem on the site.. Polylang just not working good at the moment.
have a nice day.
Jap
August 9, 2016 at 5:22 pm #96886Mahesh
Participant@rheja:
Hi Jap:I checked the child theme with Polylang and it seems to be working fine. If you have posts in that language and if that posts are showing in the language page, its displays fine.
Regards,
MaheshAugust 9, 2016 at 6:15 pm #96889Rheja
ParticipantOk, It is very strange. Because of the childtheme Polylang keeps seeing my old promotional heading. And is not letting me change it in the stringtranslation.
How is this possible!? the rest is translated only the homepage texts not!
regards
jap
August 9, 2016 at 6:30 pm #96890Rheja
ParticipantOk I did find it. I had to copy my wpml-config.xml into my child folder..
And edit the file to change
<key name="theme_mods_full-frame-pro">
into<key name="theme_mods_full-frame-pro-child">
It is working now! Thank you for the patience and help..
I really like your sollution!!
jap
August 10, 2016 at 9:34 am #96962 -
AuthorPosts
- The topic ‘Featured Image Slider’ is closed to new replies.