WordPress.org

Ready to get started?Download WordPress

Forums

Forever Theme: Remove header text and image from subpages (4 posts)

  1. rldowd
    Member
    Posted 6 months ago #

    Can anyone share the code I need to adjust in header.php to remove the header text and image from every page except the home page.

    I'm super new to WP and coding in general, but I'm guessing it has something to do with this in header.php?

    <?php do_action( 'before' ); ?>
    <?php get_template_part( 'masthead' ); ?>
    <div id="main">

    My site is http://www.racheldowd.net
    Thanks!!

  2. wpfan1000
    Member
    Posted 6 months ago #

    Hi,

    There are 2 ways of doing this:

    1)

    Use
    http://codex.wordpress.org/Function_Reference/is_home

    if you have a post on the front or

    http://codex.wordpress.org/Function_Reference/is_front_page

    if you have a page on the front

    Eg:
    <?php
    is_front_page() get_template_part( 'masthead' );
    ?>

    This presumes masthead prints out header text and image which may or not be the case.

    2)

    With css you can use
    display:none
    to not display your header text and image in all pages
    and then use
    display:inline;
    to display the header text and image only on the front page

    I would also ask the theme developer.

    I hope this gets you started.

  3. WPyogi
    Volunteer Moderator
    Posted 6 months ago #

    I would also ask the theme developer.

    @rldowd - you can do that by posting on the theme's dedicated forum here:

    http://wordpress.org/support/theme/forever

  4. rldowd
    Member
    Posted 6 months ago #

    Thank you @wpfan1000. I'll try that!

Reply

You must log in to post.

About this Topic