Page 1 of 1

Help needed with inserting logo image file instead of text.

Posted: Sun Mar 15, 2009 12:25 pm
by viraj86
Hello everybody
My first post
I use wordpress platform. The theme that I am curently using is very good except that I want a logo at the top left(*.gif) instead of the title text that appaears.
I would be happy if anybody helps me with coding the header.php and header_with_text.php files to insert the logo. I have attached the logo. Do I need to modify the size of the pic...etc...pls help m a newbie

HEader.php

Code: Select all

 
<?php include(TEMPLATEPATH."/config.inc.php");?>
 
<!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">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="en, sv" />
 
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<!-- leave this for stats please -->
 
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="http://feeds2.feedburner.com/viraj86" /><?php /* if you put your feedburner into the theme options, the autodiscover will use that instead of the WP default feed */ ?>
 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php wp_head(); ?>
<style type="text/css" media="screen">
<!-- @import url( <?php bloginfo('stylesheet_url'); ?> ); -->
</style>
<meta name="blogcatalog" content="9BC9082038" /> 
</head>
 
<body>
<div class="top"><img src="<?php bloginfo('template_url'); ?>/images/top.gif" alt="" /></div>
 
<div id="body-container">
 
<div id="header">
 
 
<div class="headline">
<h1><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>"><?php bloginfo('name'); ?></a></h1>
</div>
<?php include(TEMPLATEPATH."/ad_top.php");?>
<div class="TopMenu">
   <ul>
     <li><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>" id="home">Home</a></li><?php wp_list_pages('depth=1&sort_column=menu_order&title_li=' . __('') . '' ); ?>
   </ul>
<div class="rss"><a href="<?php if($db_feedburner_address) { echo $db_feedburner_address; } else { bloginfo('rss2_url'); }?>"><img src="<?php bloginfo('template_url'); ?>/images/rss.jpg" alt=""></img></a></div>
</div>
 
</div>
 
 
 
Header with Text.php

Code: Select all

 
 
<!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">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="en, sv" />
 
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<!-- leave this for stats please -->
 
<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'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php wp_head(); ?>
<style type="text/css" media="screen">
<!-- @import url( <?php bloginfo('stylesheet_url'); ?> ); -->
</style>
</head>
 
<body>
<div id="body-container">
 
<div id="header">
 
<div class="TopMenu">
   <ul>
     <li><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>" id="home">Home</a></li><?php wp_list_pages('depth=1&sort_column=menu_order&title_li=' . __('') . '' ); ?>
   </ul>
</div>
 
<div class="headline">
<h1><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>"><?php bloginfo('name'); ?></a></h1>
<div class="Desc"><?php bloginfo('description'); ?></div>
</div>
 
 
</div>
 
 

Thanks do ... let me know if I need other files

Re: Help needed with inserting logo image file instead of text.

Posted: Sun Mar 15, 2009 3:11 pm
by Benjamin
Please use the appropriate

Code: Select all

 [ /code] tags when posting code blocks in the forums.  Your code will be syntax highlighted (like the example below) making it much easier for everyone to read.  You will most likely receive more answers too!

Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces.  You can even start right now by editing your existing post!

If you are new to the forums, please be sure to read:

[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]

If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online.  You'll find code samples, detailed documentation, comments and more.

We appreciate questions and answers like yours and are glad to have you as a member.  Thank you for contributing to phpDN!

Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]

Re: Help needed with inserting logo image file instead of text.

Posted: Mon Mar 16, 2009 9:17 am
by viraj86
Sorry Web master ....edited my post...was my first post. Hope i get some help now

Re: Help needed with inserting logo image file instead of text.

Posted: Mon Mar 16, 2009 10:54 am
by Jonah Bron
In the HEader.php file, this looks like the part you are looking for:

Code: Select all

...
<div id="header">
<div class="headline">
>>>>>>><h1><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>"><?php bloginfo('name'); ?></a></h1>
</div>
<?php include(TEMPLATEPATH."/ad_top.php");?>
<div class="TopMenu">
...
Maybe replace the line marked with:

Code: Select all

<h1><a href="<?php bloginfo('url'); ?>" title="<?php _e('Home'); ?>"><img src="ADDRESS_OF_YOUR_LOGO_FILE" /></a></h1>
That should replace the file's retreiving the name of the blog, with a static image.