Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17869
    Betty
    Member

    Hi,

    Building my very first website. I know I can use the featured slider in my website but I would like to have the slider in my header. Is that possible?
    http://digidoc.be/wordpress
    Thanks in advance.
    Kind regards.
    Betty

    #17873
    Sakin
    Keymaster

    @Betty: It’s complicated. To position the slider in header you need to use action hooks. You need to build child theme and then add the following php code in your child theme functions.php file

    /**
     * Display slider
     */
    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 ( ( $enableslider == 'enable-slider-allpage' ) || ( ( is_front_page() || ( is_home() && $page_id != $page_for_posts ) ) && $enableslider == 'enable-slider-homepage' ) ) :
    	
    		// Select Slider
    		if ( $sliderselect =='image-slider' && !empty( $options[ 'featured_image_slider_image' ] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_imagesliders' ) ) {
    			add_action( 'catchevolution_before_contentsidebarwrap', 'catchevolution_imagesliders', 15 );
    		}	
    		elseif ( $sliderselect =='post-slider' && !empty( $options[ 'featured_slider' ] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_sliders' ) ) {
    			add_action( 'catchevolution_after_headercontent', 'catchevolution_sliders', 15 );
    		}
    		elseif ( $sliderselect =='page-slider' && !empty( $options[ 'featured_slider_page' ] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_page_sliders' ) ) {
    			add_action( 'catchevolution_after_headercontent', 'catchevolution_page_sliders', 15 );
    		}		
    		elseif ( $sliderselect =='category-slider' && !empty( $options[ 'slider_category' ] ) && $sliderlayout =='fullwidth' && function_exists( 'catchevolution_category_sliders' ) ) {
    			add_action( 'catchevolution_after_headercontent', 'catchevolution_category_sliders', 15 );
    		}		
    		elseif ( $sliderselect =='image-slider' && !empty( $options[ 'featured_image_slider_image' ] ) && function_exists( 'catchevolution_imagesliders' ) ) {
    			add_action( 'catchevolution_content', 'catchevolution_imagesliders', 10 );
    		}
    		elseif ( $sliderselect == 'post-slider' && !empty( $options[ 'featured_slider' ] ) && function_exists( 'catchevolution_sliders' ) ) {
    			add_action( 'catchevolution_content', 'catchevolution_sliders', 10 );
    		}
    		elseif ( $sliderselect =='page-slider' && !empty( $options[ 'featured_slider_page' ] ) && function_exists( 'catchevolution_page_sliders' ) ) {
    			add_action( 'catchevolution_content', 'catchevolution_page_sliders', 10 );
    		}
    		elseif ( $sliderselect == 'category-slider' && !empty( $options[ 'slider_category' ] ) && function_exists( 'catchevolution_category_sliders' ) ) {
    			add_action( 'catchevolution_content', 'catchevolution_category_sliders', 10 );
    		}
    		else {
    			add_action( 'catchevolution_content', 'catchevolution_default_sliders', 10 );
    		}
    		
    	endif;
    	
    }
    #17900
    Betty
    Member

    Thanks for the quick reply. I’ll give it a try :-).

    Kind regards,

    Betty

    #18008
    FleurdeSante
    Member

    Hi I don’t want the slider in the header but would like to know how to add my own images and remove the stock. Using Catch Evolution Theme. Thank you.

    #18023
    Sakin
    Keymaster

    @FleurdeSante: Sorry I don’t get it what you mean. Check our theme instruction page at http://catchthemes.com/theme-instructions/catch-evolution-pro/ where you will see details on how to add featured Image slider. This will replace the stock images.

    #18169
    Betty
    Member

    Hi, I made a child theme and put everything in like mentionned above. I had a preview and that looked allright. Then I activated the child theme and now I have nothing anymore. I only get
    Fatal error: Cannot redeclare catchevolution_custom_header_setup() (previously declared in /home/digidocb/public_html/wordpress/wp-content/themes/catch-evolution-pro/inc/custom-header.php:26) in /home/digidocb/public_html/wordpress/wp-content/themes/catch-evolution-pro/inc/custom-header.php on line 67
    How can I solve this please?
    Thanks in advance

    #18173
    Sakin
    Keymaster

    @Betty: You can not supposed to add the function in Child Theme directly as this function is added through action hook and to make changes you need to do it from action hook. I don’t know why you need to adjust this function. If you are trying to change the image then you can change it from “Appearance => Header”.

    Now you need to delete your child theme from FTP or Hosting Control panel.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Slider in header’ is closed to new replies.