WordPress.org

Support

Support » Themes and Templates » [Resolved] [Theme: Oenology] Header graphics issue

[Resolved] [Theme: Oenology] Header graphics issue

  • Chip

    I’m new to WP and so this whole theme/plugin/widget thing was/is a bit overwhelming. In the end I decided to try your theme because it’s developed from a teaching standpoint and appears to be more of a labor of love than most others.

    So I’m onto my first task, that of putting my logo into the header. I created and fully sized an image for the header. The first try, a png file with transparent background came in a black background .. I guess from an image converter. The second attempt, a bmp file with a white background came in as such in the preview window BUT in the actual page it loads grey, and the headline texts are there too.

    Any ideas as to what I’m bumping ino here? I’m suspecting it might be that there is a black image file from the menu that is laying over or behind the header graphic.

    I’m using Varietal and there is no background image in use. Also I have not setup any menu yet.

    Thanks for any help!

    http://wordpress.org/extend/themes/oenology/

Viewing 15 replies - 1 through 15 (of 24 total)
  • I know what happened to the png file that went black .. it was oversized by a few pixels as I was trimming to place the graphic stratgegically, and thus WP converted it to a jpg file, as I found in the media library.

    The rest is still a problem ..

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    @breezyohio,

    I appreciate you using Oenology! Do you have a link to the live site, so I can see what’s happening?

    Thanks!

    Chip

    here it is ..
    http://xxxxx/~
    It’s a temporary location for testing ..

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    Thanks for that!

    This is a known issue, and will be fixed in version 2.5. (I had to submit a core patch to get it fixed properly, but I’ll have a workaround in Oenology in the meantime.)

    Okay .. is there an edit I can do with header.php in the meantime? If it’s soon to be fixed I’ll just let it go as it will be a few days till live publish.

    I’ll edit out that live link too if it’s okay with you ..

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    Here’s the simple fix.

    Look in \functions\hooks.php, line 872:

    function oenology_hook_site_header() {
    
    	$site_header = '';
    
    	// Displays the blog name, as defined on the General Settings page in the administration panel
    	$site_header .= '<div class="site-header-text">' . get_bloginfo( 'name' ) . '</div>';
    	// Displays the blog description, as defined on the General Settings page in the administration panel
    	$site_header .= '<p>' . get_bloginfo( 'description' ) . '</p>';
    
    	echo apply_filters( 'oenology_hook_site_header', $site_header );
    }

    The fix for this function is as follows:

    function oenology_hook_site_header() {
    
    	$site_header = '';
    
    	$site_header_name = ( 'blank' != get_header_textcolor() ? get_bloginfo( 'name' ) : '&nbsp;' );
    	$site_header_description = ( 'blank' != get_header_textcolor() ? get_bloginfo( 'description' ) : '&nbsp;' );
    
    	// Displays the blog name, as defined on the General Settings page in the administration panel
    	$site_header .= '<div class="site-header-text">' . $site_header_name . '</div>';
    	// Displays the blog description, as defined on the General Settings page in the administration panel
    	$site_header .= '<p>' . $site_header_description . '</p>';
    
    	echo apply_filters( 'oenology_hook_site_header', $site_header );
    }

    If you want, just overwrite the function accordingly.

    However, there is a safer way to do it: use the custom oenology_hook_site_header filter. e.g. add this to the bottom of functions.php (or in a Child Theme):

    function custom_oenology_site_header_filter( $site_header ) {
        $site_header = '&nbsp;'
        return $site_header;
    }
    add_filter( 'oenology_hook_site_header', 'custom_oenology_site_header_filter' );

    If that’s confusing, just use the first option, of overwriting the function with the new function code.

    That last option would be for editing/adding code to functions.php .. would that be before the
    ?>

    or after that line?

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    That is a closing PHP tag, so you’ll want to add PHP immediately before it.

    Yep, thought so.

    So when I do this I’m getting ..
    Parse error: syntax error, unexpected T_RETURN in /home/jwhit/public_html/wp-content/themes/oenology/functions.php on line 132

    line 132 on my file is ..
    return $site_header;

    Any thoughts?

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    Syntax error on my part. 🙂

    Change this:

    $site_header = '&nbsp;'

    …to this:

    $site_header = '&nbsp;';

    Yes, those darn syntax errors .. I understand 😉

    Just a heads up though .. that did get rid of the text but also got rid of the header image as well

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    I should not post help when distracted. 🙂

    Try this instead:

    function custom_oenology_site_header_filter( $site_header ) {
        $site_header = '';
        $site_header .= '<div class="site-header-text">&nbsp;</div>';
        $site_header .= '<p>&nbsp;</p>';
        return $site_header;
    }
    add_filter( 'oenology_hook_site_header', 'custom_oenology_site_header_filter' );

    Chip

    Yes, this stuff is too tricky to do when distracted by your day job, for sure.

    results are ..
    no text (no matter what is selected in the header settings)
    there is still a grey overlay over the header image.

    I’m not really sure where this grey is coming from. Thanks for giving it an effort and when you get it further down the road or if you want me to try something just reply to this thread. I’ll be happy to try it out.

    Theme Author Chip Bennett

    @chipbennett

    Theme Review Admin

    The opaque overlay is added via CSS, via the oenology_header_style() callback, defined in \functions\theme-setup.php.

    Specifically, on line 494:

    #site-header-text {
    	background: rgba(0, 0, 0, 0.2);
    }

    This opacity is applied when a non-default header image is selected.

    If you want to override it, you can again use a filter:

    function custom_oenology_header_style() {
        ?>
    <style type="text/css">
    #site-header-text {
        background: none;
    }
    </style>
        <?php
    }
    // Use a priority of 99, to ensure this outputs last
    add_action( 'wp_print_styles', 'custom_oenology_header_style', 99 );

    (Untested, mainly because I don’t have access to test just at the moment…)

    Would I add that function to the functions.php file as before?

    just curious .. why would you ever want to add a shaded overlay to a non default header image or is that just some leftover code from something else?

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘[Resolved] [Theme: Oenology] Header graphics issue’ is closed to new replies.