Wordpress header images

Discussion in 'HTML & Website Design' started by drew68, Sep 24, 2014.

  1. #1
    Trying to get the header image to change on every page is such a pain with Wordpress!

    I know the deal with featured images but this is a customized theme.

    http://sandersscott.wp.hobbsherder.com

    The header images need to change on every page and all the images are in each page as Featured images.

    I place this in the header.php file and it breaks the site...

    <!--- BEGIN featured image header --->
            <?php
            if (has_post_thumbnail()){
            echo'<div class="art-header-noimage">';
            the_post_thumbnail('full');
            }
            else{
            echo '<div class="art-header">';
            }
            ?>
           <!--- END featured image header --->
    Code (markup):
     
    Last edited by a moderator: Sep 24, 2014
    drew68, Sep 24, 2014 IP
  2. partyboy

    partyboy Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    The end statement are supposed to be before ?>
    Can you post the output error you are getting?

    /Partyboy
     
    Last edited by a moderator: Sep 24, 2014
    partyboy, Sep 24, 2014 IP
  3. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #3
    partyboy..thanx for responding...below is what i have in the header.php file. i need to place this code in the header file below...

    <!--- BEGIN featured image header --->
    <?php
    if (has_post_thumbnail()){
    echo'<div class="art-header-noimage">';
    the_post_thumbnail('full');
    echo '</div>;
    }
    else{
    echo '<div class="art-header"></div>';
    }
    ?>
    <!--- END featured image header --->
    PHP:



    HEADER.PHP
    <body <?php if(function_exists('body_class')) body_class(); ?>>
    <div id="hh-page-background-glare-wrapper">
        <div id="hh-page-background-glare"></div>
    </div>
    <div id="hh-main">
        <div class="cleared reset-box"></div>
        <div id="hh-header-bg" class="hh-header">
        </div>
        <div class="cleared reset-box"></div>
        <div class="hh-box hh-sheet">
            <div class="hh-box-body hh-sheet-body">
                <div class="hh-header">
                    <div class="hh-bar hh-nav">
                        <div class="hh-nav-outer">
                        <div class="hh-nav-wrapper">
                        <div class="hh-nav-inner">
                        <?php
                            echo theme_get_menu(array(
                                    'source' => theme_get_option('theme_menu_source'),
                                    'depth' => theme_get_option('theme_menu_depth'),
                                    'menu' => 'primary-menu',
                                    'class' => 'hh-hmenu'
                                )
                            );
                        ?>
                        </div>
                        </div>
                        </div>
                    </div>
                    <div class="cleared reset-box"></div>
                    <div class="hh-logo">
                            <div style="margin:10px 0 0 0;">Harry & Scott Sanders for Baltimore and Harford Counties Real Estate | Contact Us: 410-879-8080 &nbsp;&nbsp; <a href="#" target="_blank"><img src="/wp-content/themes/sanders_scott/images/social-facebook.jpg" alt="Facebook" width="24" height="24"/></a>&nbsp;<a href="#" target="_blank"><img src="/wp-content/themes/sanders_scott/images/social-twitter.jpg" alt="twitter" width="24" height="24"/></a>&nbsp;<a href="#" target="_blank"><img src="/wp-content/themes/sanders_scott/images/social-linkedin.jpg" alt="linkedin" width="24" height="24"/></a>&nbsp;<a href="#" target="_blank"><img src="/wp-content/themes/sanders_scott/images/social-youtube.jpg" alt="youtube" width="24" height="24"/></a></div>
                            </div>
                </div>
                <div class="cleared reset-box"></div>
    PHP:
     
    Last edited by a moderator: Sep 25, 2014
    drew68, Sep 25, 2014 IP
  4. partyboy

    partyboy Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    This is wrong!

    Correct is <?php if(function_exists('body_class')) body_class(); ?> <body>

    Why is this statement alone when you can put it below the body tag?
     
    partyboy, Sep 25, 2014 IP
  5. drew68

    drew68 Well-Known Member

    Messages:
    582
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #5
    thank you partyboy! i've noted this!
     
    drew68, Oct 21, 2014 IP