• Resolved jyoshimura

    (@jyoshimura)


    How can I hide the jumbotron / header image and search box on all pages except for the home page? For example, if a user is viewing an article, I want the content to be above the fold on small screens.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Hardeep Asrani

    (@hardeepasrani)

    Hey,

    Could you give me the link to your website? Thank you. ??

    Regards,
    Hardeep

    Thread Starter jyoshimura

    (@jyoshimura)

    https://help.welltok.com — there’s no content in there yet except for a post titled “Testing”. Thanks for your help!

    Theme Author Hardeep Asrani

    (@hardeepasrani)

    Hey,

    In the header.php file, replace the following:

    <header class="jumbotron" style="background: transparent url('<?php header_image(); ?>') no-repeat scroll center center / cover;">
    	<div class="container text-center">
    	<?php
    		$docpress_header_title = get_theme_mod('docpress_header_title',__( 'Need Help? Try me!', 'docpress' ));
    		$docpress_header_subtitle = get_theme_mod('docpress_header_subtitle',__( 'Your answer is just one search away!', 'docpress' ));
    		$docpress_header_search_display = get_theme_mod('docpress_header_search_display');
    	?>
    	<?php if(!empty($docpress_header_title)) : ?>
    		<h2><?php echo esc_html($docpress_header_title); ?></h2>
    	<?php else: ?>
    		<h2><?php bloginfo( 'description' ); ?></h2>
    	<?php endif; ?>
    	<?php if(!empty($docpress_header_subtitle)) : ?>
    		<h3><?php echo esc_html($docpress_header_subtitle); ?></h3>
    	<?php endif; ?>
    	<?php if( isset($docpress_header_search_display) && $docpress_header_search_display != 1 ): ?>
    		<?php get_search_form(); ?>
    	<?php endif; ?>
    	</div>
    </header>

    with:

    <?php if ( is_front_page() ) : ?>
    <header class="jumbotron" style="background: transparent url('<?php header_image(); ?>') no-repeat scroll center center / cover;">
    	<div class="container text-center">
    	<?php
    		$docpress_header_title = get_theme_mod('docpress_header_title',__( 'Need Help? Try me!', 'docpress' ));
    		$docpress_header_subtitle = get_theme_mod('docpress_header_subtitle',__( 'Your answer is just one search away!', 'docpress' ));
    		$docpress_header_search_display = get_theme_mod('docpress_header_search_display');
    	?>
    	<?php if(!empty($docpress_header_title)) : ?>
    		<h2><?php echo esc_html($docpress_header_title); ?></h2>
    	<?php else: ?>
    		<h2><?php bloginfo( 'description' ); ?></h2>
    	<?php endif; ?>
    	<?php if(!empty($docpress_header_subtitle)) : ?>
    		<h3><?php echo esc_html($docpress_header_subtitle); ?></h3>
    	<?php endif; ?>
    	<?php if( isset($docpress_header_search_display) && $docpress_header_search_display != 1 ): ?>
    		<?php get_search_form(); ?>
    	<?php endif; ?>
    	</div>
    </header>
    <?php endif; ?>

    Hope it helps. ??

    Thread Starter jyoshimura

    (@jyoshimura)

    Excellent! Thank you for the quick response.

    Theme Author Hardeep Asrani

    (@hardeepasrani)

    Glad to be of help. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show jumbotron only on home page’ is closed to new replies.