WordPress.org

Forums

Hellish Simplicity
[resolved] Use Image in Header instead of Text? (2 posts)

  1. m2c1r
    Member
    Posted 11 months ago #

    Any chance you would feel like posting a snippet of code here so I can use an image instead of the text for the header? :) I can put the image URL in the Header file if I had a clue how to put the code bit in that would surround it...

    Love the theme overall! Cheers,

    Matt

  2. Ryan Hellyer
    Member
    Theme Author

    Posted 7 months ago #

    Sorry, but I didn't see your question until now.

    Below is a replacement header.php file which displays an image instead of text in the header. It doesn't use the WordPress custom header functionality, but you can always adapt it to use that if you want. Or you can simply change the image URL I've used to save coding all that stuff in.

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package Hellish Simplicity
     * @since Hellish Simplicity 1.1
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <!--[if lt IE 9]>
    <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
    <![endif]-->
    <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    
    <header id="site-header" role="banner">
    	<div class="hgroup">
    		<img src="http://uploads.ryanhellyer.net/ryan/2012/04/oslo-city1-680x313.jpg" alt="" style="width:100%;height:auto;" />
    	</div><!-- .hgroup -->
    </header><!-- #masthead -->
    
    <div id="main" class="site-main">

    Note: I haven't tested the above code. So if something doesn't work, just let me know and I'll take a closer look for you :)

Reply

You must log in to post.

About this Theme

About this Topic