Tagged: , ,

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #96810
    Rheja
    Participant

    Hello,

    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

    #96859
    Mahesh
    Keymaster

    @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,
    Mahesh

    #96877
    Rheja
    Participant

    Ok,

    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!

    #96880
    Rheja
    Participant

    Ok, 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

    #96881
    Mahesh
    Keymaster

    @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,
    Mahesh

    #96883
    Rheja
    Participant

    Ok.. 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

    #96885
    Rheja
    Participant

    Ok 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

    #96886
    Mahesh
    Keymaster

    @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,
    Mahesh

    #96889
    Rheja
    Participant

    Ok, 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

    #96890
    Rheja
    Participant

    Ok 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

    #96962
    Mahesh
    Keymaster

    @rheja:
    Hi Jap,

    Glad to know you’ve found the solution yourself. This might help others too who are having the same issue. Thank you for your appreciation. Have a nice day!

    Regards,
    Mahesh

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Featured Image Slider’ is closed to new replies.