• im running the standard HoPE 2.5.1 theme by Patrick but i want to hide the blog title and replace it with my company logo which is 246×94 pixels large. the name of the file is ‘logo.gif’

    what code do i have to change to make this happen?
    I’d like it to be positioned where he blog title is too.

    at the moment the header.php looks like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">
    
    	<title>
    	<?php if ( is_home() ) { ?>
    		<?php bloginfo('description'); ?> <?php bloginfo('name'); ?>
    	<?php } else { ?>
    		<?php wp_title(''); ?> - <?php bloginfo('name'); ?>
    	<?php } ?>
    	</title>
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    	<!--[if lte IE 7]>
    	<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/ie7.css" />
    	<style type="text/css">#gradient{visibility:hidden;}</style>
    	<![endif]-->
    	<!--[if lt IE 6]>
    	<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/ie6-.css" />
    	<style type="text/css">#gradient{visibility:hidden;}</style>
    	<![endif]-->
    
    	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    	<script type="text/javascript">
    	var simpleGallery_navpanel={
    		panel: {height:'45px', opacity:0.5, paddingTop:'5px', fontStyle:'bold 11px Verdana'},
    		images: [ '<?php echo get_bloginfo('template_directory'); ?>/images/left.png', '<?php echo get_bloginfo('template_directory'); ?>/images/play.gif', '<?php echo get_bloginfo('template_directory'); ?>/images/right.png', '<?php echo get_bloginfo('template_directory'); ?>/images/pause.gif'],
    		imageSpacing: {offsetTop:[-4, 99, -4], spacing:20},
    		slideduration: 100
    	}
    	</script>
    
    	<script type="text/javascript" src="<?php echo get_bloginfo('template_directory');?>/jquery-pack.js?<?php echo time(); ?>"></script>
    	<?php
    		wp_enqueue_script( 'gallery', get_bloginfo('template_directory').'/simplegallery.js', array( 'jquery' ) );
    		if ( is_singular() )
    			wp_enqueue_script( 'comment-reply' );
    	?>
    
    <?php wp_head(); ?>
    <?php if ( get_bloginfo('language') == 'zh' ) { ?>
    <style type="text/css">
    .entry-content { font-size: 1.5em;color:#777; font-family: georgia, arial;}
    .wp-caption p.wp-caption-text {font-size: 1em;}
    </style>
    <?php } ?>
    
    </head>
    <body>
    <div id="page" class="hfeed">
    
    	<div id="header">
    		<div class="search">
    		<form method="get" id="searchform" action="<?php bloginfo('home'); ?>">
    			<input type="text" onfocus="if (this.value == 'Search this blog') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this blog';}" value="Search this blog" name="s" />
    		</form>
    		</div>
    
    		<div id="branding">
    			<?php if (is_home()) { ?>
    			<h1 class="homelink"><a href="<?php bloginfo(images/logo.jpg); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    			<p class="description"><?php bloginfo('description'); ?></p>
    			<?php } else { ?>
    			<div class="homelink"><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></div>
    			<p class="description"><?php bloginfo('description'); ?></p>
    			<?php } ?>
    		</div>
    
    		<div id="skip"><a title="Skip to content" href="#content" accesskey="S">Skip to Content &darr;</a></div>
    
    	</div><!--#header-->
    <div id="container">
    
    	<div id="rotating">
    		<div id="gradient">
    			<ul class="menu">
    				<li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a title="<?php bloginfo('name'); ?>" href="<?php bloginfo('url'); ?>">Blog</a></li>
    				<?php wp_list_pages('depth=1&title_li=&exclude='); ?>
    			</ul>
    			<div id="note">
    				<div id="simplegallery"></div>
    			</div>
    		</div>
    	</div>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Dandym,
    you should replace the bloginfo(‘name’) part with your imgae code, try this code within the branding div:

    <div id="branding">
    			<?php if (is_home()) { ?>
    			<h1 class="homelink"><a href="<?php echo bloginfo('home'); ?>"><img src="logo.gif" alt="<?php bloginfo('name'); ?>" /></a></h1>

    MAD
    http://flashjourney.com/

    Thread Starter dandym

    (@dandym)

    Hi thanks for replying,
    is still not working – nothing has changed (i cleared the cache and tried)

    I changed the code to what you suggested
    is there anything else I should be doing, maybe in the style.css?
    maybe something to do with my the ‘logo.gif’ file is in images/logo.gif if thats any help
    I don’t really know what I’m going on about! Very new to all of this.

    "branding">
    			<?php if (is_home()) { ?>
    			<h1 class="homelink"><a href="<?php echo bloginfo('home'); ?>"><img src="logo.gif" alt="<?php bloginfo('name'); ?>" /></a></h1>
    			<p class="description"><?php bloginfo('description'); ?></p>
    			<?php } else { ?>
    			<div class="homelink"><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></div>
    			<p class="description"><?php bloginfo('description'); ?></p>
    			<?php } ?>

    Well I thought the logo.gif was in the template root folder. If it is in the images folder then change the following code
    src=”logo.gif”

    to

    src=”<?php bloginfo(‘template_url’); ?>/images/logo.gif”

    Try that

    MAD

    Thread Starter dandym

    (@dandym)

    Yeah, thats got it fixed. MAD000 you are a legend, thanks a bunch.

    Thread Starter dandym

    (@dandym)

    Hi there, it only works for the home page, when i click on my ‘about’ page, my logo isnt there, but the old text is?
    How do makeit so the logo shows up on all the pages?

    No probe Dandym.
    Your home page uses the index.php template. Your other pages might use different templates depending on wether it is a category, a post, an archive … etc.
    I think you might need to change other templates like the single.php or archive.php.
    however, your code is written specifically for the home page (index.php), best practice is to split you code into four main sections as follows:
    Header Section which goes to header.php
    Content Section which goes to index.php
    Sidebar Section which goes to sidebar.php
    and finally, Footer Section which goes to footer.php

    This way you only need to do changes in one place. For instance, your above code could be divided into header and content.

    Then all you need to do in your wordpress template file (index.php, single.php, archive.php … etc) is include call to the header.php, sidebar.php and footer.php as and when required.

    Regards,
    MAD
    PS: I will cover a complete simple tutorial on creating a wordpress theme in my blog http://flashjourney.com/ once I am done with the new theme (curently fixing ie bugs and issues). You can follow me on twitter by the name @mad000.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘change blog title to image in HoPE theme’ is closed to new replies.