• Resolved janeymae

    (@janeymae)


    Hi there.
    My blog is https://www.littlewanderluststories.com

    I have a banner on my site which is an interactive map. However, this banner shows up on every page… I only want the banner to stick to the main page.

    Is there a way to do this?

    The theme i am using is Pure and Simple.

    Thanks,
    Janey

Viewing 4 replies - 1 through 4 (of 4 total)
  • Check front page or not on sidebar-banner.php. is_front_page

    Do yourself or replace the sidebar-banner.php code by the below code.

    <?php
    /**
     * Sidebar for the banner area and the Header Caption option
     * @package Pure_and_Simple
     * @since 1.0.0
     */
    if ( is_front_page() ) {
    
    $hide_defaults = get_theme_mod('hide_default_content','0');
    if ( ! is_active_sidebar( 'banner' ) && (!$hide_defaults) ): ?>
    	<aside class="widget-area" role="complementary"><div id="page-banner" role="banner">
    			<img src="<?php  echo esc_url( get_template_directory_uri() ); ?>/images/banner.jpg" />
    		</div></aside>
    	<?php
    elseif(is_active_sidebar( 'banner' ) ):
    
    		echo '<aside class="widget-area" role="complementary"><div id="page-banner" role="banner">';
    	dynamic_sidebar( 'banner' );
    	echo '</div></aside>';
    else:
    	return;
    endif;
    }
    ?>

    If not work, let me know.
    Note: Child theme is recommended to customize theme.
    Thanks

    Thread Starter janeymae

    (@janeymae)

    Hi!
    Thanks so much for the code.

    Just before i try – i’m not very confident with CSS codes.
    I have a plugin called Simple CSS can i simply paste it into here or do i have to go into the themes CSS?

    Thanks.

    Thread Starter janeymae

    (@janeymae)

    Hi i just tried to past that in and it didn’t work!

    I hope i’m doing it right…

    Thread Starter janeymae

    (@janeymae)

    Scratch that! IT WORKS

    thank you so much ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I want the banner on homepage only’ is closed to new replies.