• Hello,

    I’m using corporate lite themes from flythemes and I’d like to get header slider on all pages so I cheked my header.php and here the code :

    <strong> <?php
    
    /**
    
     * The Header for our theme.
    
     *
    
     * Displays all of the <head> section and everything up till <div id="content">
    
     *
    
     * @package Corporate Lite
    
     */
    
    ?><!DOCTYPE html>
    
    <html <?php language_attributes(); ?>>
    
    <head>
    
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    
    <meta name="viewport" content="width=device-width">
    
    <link rel="profile" href="https://gmpg.org/xfn/11">
    
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    
    <?php wp_head(); ?>
    
    </head>
    
    <body <?php body_class(); ?>>
    
    <div class="top-bar">
    
    		<div class="aligner">
    
            		<div class="top-left"><p class="call"><?php echo esc_attr(get_theme_mod('cont_phone','+1 500 000 0000')); ?></p><p class="mail"><a href="mailto:<?php echo esc_attr(get_theme_mod('cont_email','[email protected]')); ?>"><?php echo esc_attr(get_theme_mod('cont_email','[email protected]')); ?></a></p>
    
                    </div><!-- top-left -->
    
                    <div class="top-right"><?php get_template_part( 'menu', 'social' ); ?>
    
                    </div><!-- top-right --><div class="clear"></div>
    
            </div><!-- aligner -->
    
    </div><!-- top-bar -->
    
    <div class="header">
    
                		<div class="aligner">
    
                        		<div class="logo">
    
                                		<?php corporate_lite_the_custom_logo(); ?>
    
    						<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php esc_attr(bloginfo( 'name' )); ?></a></h1>
    
    					<?php $description = get_bloginfo( 'description', 'display' );
    
    					if ( $description || is_customize_preview() ) : ?>
    
    						<p><?php echo $description; ?></p>
    
    					<?php endif; ?>
    
                                 </div>
    
                                 <div class="toggle">
    
                                <a class="toggleMenu" href="#"><?php _e('Menu','corporate-lite'); ?></a>
    
                                </div>                           
    
                                <div class="nav">
    
    								<?php wp_nav_menu( array('theme_location'  => 'primary') ); ?>
    
                                </div><!-- nav --><div class="clear"></div>
    
                        </div><!-- aligner -->
    
                </div><!-- header -->
    
    <?php if ( is_front_page() ) { ?>
    
    <div class="slider-main">
    
           <?php
    
    			$slideimage = '';
    
    			$slideimage = array(
    
    					'1'	=>	get_template_directory_uri().'/images/slides/slider1.jpg',
    
    					'2'	=>  get_template_directory_uri().'/images/slides/slider2.jpg',
    
    					'3'	=>  get_template_directory_uri().'/images/slides/slider3.jpg',
    
    			);
    
    			$slAr = array();
    
    			$m = 0;
    
    			for ($i=1; $i<4; $i++) {
    
    				if ( get_theme_mod('slide_image'.$i, true) != "" ) {
    
    					$imgSrc 	= esc_url(get_theme_mod('slide_image'.$i, $slideimage[$i]));
    
    					$imgTitle	= esc_attr(get_theme_mod('slide_title'.$i, true));
    
    					$imgDesc	= esc_attr(get_theme_mod('slide_desc'.$i, true));
    
    					$imglink	= esc_url(get_theme_mod('slide_link'.$i, true));
    
    					if ( strlen($imgSrc) > 4 ) {
    
    						$slAr[$m]['image_src'] = esc_url(get_theme_mod('slide_image'.$i, $slideimage[$i]));
    
    						$slAr[$m]['image_title'] = esc_attr(get_theme_mod('slide_title'.$i, true));
    
    						$slAr[$m]['image_desc'] = esc_attr(get_theme_mod('slide_desc'.$i, true));
    
    						$slAr[$m]['image_url'] = esc_url(get_theme_mod('slide_link'.$i, true));
    
    						$m++;
    
    					}
    
    				}
    
    			}
    
    			$slideno = array();
    
    			if( $slAr > 0 ){
    
    				$n = 0;?>
    
                    <div id="slider" class="nivoSlider">
    
                    <?php 
    
                    foreach( $slAr as $sv ){
    
                        $n++; ?><img src="<?php echo esc_url($sv['image_src']); ?>" alt="<?php echo esc_attr($sv['image_title']);?>" title="<?php if ( ($sv['image_title']!='') && ($sv['image_desc']!='')) { echo '#slidecaption'.$n ; } ?>"/><?php
    
                        $slideno[] = $n;
    
                    }
    
                    ?>
    
                    </div><?php
    
                    foreach( $slideno as $sln ){ ?>
    
                        <div id="slidecaption<?php echo $sln; ?>" class="nivo-html-caption">
    
                        <div class="slide-cap">
    
                            <?php if( get_theme_mod('slide_title'.$sln, true) != '' ){ ?>
    
                                <h4><?php echo esc_attr(get_theme_mod('slide_title'.$sln, __('Slide Title ','corporate-lite').$sln)); ?></h4>
    
                            <?php } ?>
    
                            <?php if( get_theme_mod('slide_desc'.$sln, true) != '' ){ ?>
    
                                <p><?php echo esc_attr(get_theme_mod('slide_desc'.$sln, __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vitae est at dolor auctor faucibus. Aenean hendrerit lorem eget nisi vulputate, vitae fringilla ligula dignissim. Phasellus feugiat quam efficitur Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vitae est at dolor auctor faucibus. Aenean hendrerit lorem eget nisi vulputate, vitae fringilla ligula dignissim. Phasellus feugiat quam efficitur','corporate-lite'))); ?></p>
    
                            <?php } ?>
    
    						<?php if( get_theme_mod('slide_link'.$sln, true) != ''){ ?>
    
                            	<a class="read-more" href="<?php echo esc_url(get_theme_mod('slide_link'.$sln,'#')); ?>"><?php _e('Learn More','corporate-lite'); ?></a>
    
                            <?php } ?>
    
                        </div>
    
                        </div><?php 
    
                    } ?>
    
                    </div>
    
                    <div class="clear"></div><?php 
    
    			}
    
                ?>
    
            </div>
    
          </div><!-- slider -->
    
    <?php } ?>
    
    <?php if( is_front_page() ) { ?>
    
    <div class="grey-strip">
    
    <div class="aligner">
    
        </div><!-- aligner -->
    
    </div><!-- grey-strip -->
    
    <?php }  ?>
    
          <div class="main-container">
    
          <?php if( function_exists('is_woocommerce') && is_woocommerce() ) { ?>
    
    		 	<div class="content-area">
    
                    <div class="middle-align content_sidebar">
    
                    	<div id="sitemain" class="site-main">
    
             <?php } ?></strong>

    I removed : <?php if ( is_front_page() ) { ?> and all pages are empty now !!

    Can you help me ?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘homepage header slider all pages’ is closed to new replies.