Tagged: featured slider
- This topic has 6 replies, 3 voices, and was last updated 10 years, 11 months ago by Sakin.
-
AuthorPosts
-
December 3, 2013 at 9:13 pm #17869BettyMember
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.
BettyDecember 3, 2013 at 11:12 pm #17873SakinKeymaster@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; }
December 4, 2013 at 4:30 pm #17900BettyMemberThanks for the quick reply. I’ll give it a try :-).
Kind regards,
Betty
December 8, 2013 at 2:50 am #18008FleurdeSanteMemberHi 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.
December 8, 2013 at 6:52 pm #18023SakinKeymaster@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.
December 11, 2013 at 5:14 pm #18169BettyMemberHi, 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 advanceDecember 11, 2013 at 5:34 pm #18173SakinKeymaster@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.
-
AuthorPosts
- The topic ‘Slider in header’ is closed to new replies.