Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113885
    wouwonline
    Participant

    Hi,

    Is it possible to switch the location of the post and the slider on te homepage? I want to place the blog post above the slider.

    Thanks!

    #113897
    Mahesh
    Keymaster

    @wouwonline: For that, you’ll need to create child theme. You can find more details on creating child theme HERE. Then copy index.php from main theme to your child theme and add the following code just above </div><!-- #content --> after <?php endif; ?>

    <?php do_action( 'catchevolution_child_after_content' ); ?>

    Then add the following code in your child theme’s functions.php

    function catchevolution_slider_display() {
    	global $post, $wp_query, $catchevolution_options_settings;
    
    	// get data value from theme options
    	$options = $catchevolution_options_settings;
    	$enableslider = $options['enable_slider'];
    	$sliderselect = $options['select_slider_type'];
    	$sliderlayout = $options['select_slider_layout'];
    
    	// Front page displays in Reading Settings
    	$page_on_front = get_option('page_on_front') ;
    	$page_for_posts = get_option('page_for_posts');
    
    	// Get Page ID outside Loop
    	$page_id = $wp_query->get_queried_object_id();
    
    	if ( ( 'enable-slider-allpage' == $enableslider ) || ( ( is_front_page() || ( is_home() && $page_id != $page_for_posts ) ) && 'enable-slider-homepage' == $enableslider ) ) :
    
    		// Select Slider
    		if ( $sliderselect =='image-slider' && !empty( $options['featured_image_slider_image'] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_imagesliders' ) ) {
    			add_action( 'catchevolution_after_contentsidebarwrap', 'catchevolution_imagesliders', 10 );
    		}
    		elseif ( $sliderselect =='post-slider' && !empty( $options['featured_slider'] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_sliders' ) ) {
    			add_action( 'catchevolution_after_contentsidebarwrap', 'catchevolution_sliders', 10 );
    		}
    		elseif ( $sliderselect =='page-slider' && !empty( $options['featured_slider_page'] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_page_sliders' ) ) {
    			add_action( 'catchevolution_after_contentsidebarwrap', 'catchevolution_page_sliders', 10 );
    		}
    		elseif ( $sliderselect =='category-slider' && !empty( $options['slider_category'] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_category_sliders' ) ) {
    			add_action( 'catchevolution_after_contentsidebarwrap', 'catchevolution_category_sliders', 10 );
    		}
    		elseif ( $sliderselect =='image-slider' && !empty( $options['featured_image_slider_image'] ) && function_exists( 'catchevolution_imagesliders' ) ) {
    			add_action( 'catchevolution_child_after_content', 'catchevolution_imagesliders', 10 );
    		}
    		elseif ( 'post-slider' == $sliderselect && !empty( $options['featured_slider'] ) && function_exists( 'catchevolution_sliders' ) ) {
    			add_action( 'catchevolution_child_after_content', 'catchevolution_sliders', 10 );
    		}
    		elseif ( $sliderselect =='page-slider' && !empty( $options['featured_slider_page'] ) && function_exists( 'catchevolution_page_sliders' ) ) {
    			add_action( 'catchevolution_child_after_content', 'catchevolution_page_sliders', 10 );
    		}
    		elseif ( 'category-slider' == $sliderselect && function_exists( 'catchevolution_category_sliders' ) ) {
    			add_action( 'catchevolution_child_after_content', 'catchevolution_category_sliders', 10 );
    		}
    		else {
    			add_action( 'catchevolution_child_after_content', 'catchevolution_default_sliders', 10 );
    		}
    
    	endif;
    }

    Then go to Dashboard=> Appearance=> Customize=> Additional CSS box and add the following CSS:

    .content-sidebar-wrap {
        clear: both;
        content: " ";
        display: inline-block;
    }

    Regards,
    Mahesh

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Switch location Blog post and slider on homepage’ is closed to new replies.