We help IT Professionals succeed at work.

Twenty Ten - Link in the header image?

carpanta asked
Last Modified: 2012-06-27
I'm trying to put a link to my website in the header image or banner of my blog, so anyone who clicks on the banner gets directed to my website. Ive searched  and googled it but theres something weird or wrong with my header.php file because it doesnt have the same code that any of the "solutions" Ive found. Im using twenty ten v1.3 and the latest version of WP, I think its 3.3.1. Heres my entire header.php :

vti_timelastmodified:TR|25 Jan 2012 01:35:17 -0000
vti_cacheddtm:TX|25 Jan 2012 01:35:17 -0000

Open in new window

Ive found a couple of possible solutions, one of them by the alchymyst, but since my code is completely different it doesnt do anything

WARNING: I have no experience with php, and Im relatively new to blogs as well, certainly new to the css programming side of things

thanks for any help
Watch Question

Jason C. LevineDon't talk to me.

I have no idea what that is or why it appears in your theme's header.php.  Are you sure you are looking in wp-content/themes/twentyten ?

This is what TwentyTen is supposed to look like:

 * The Header for our theme.
 * Displays all of the <head> section and everything up till <div id="main">
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
	 * Print the <title> tag based on what is being viewed.
	global $page, $paged;

	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );

<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.

<body <?php body_class(); ?>>
<div id="wrapper" class="hfeed">
	<div id="header">
		<div id="masthead">
			<div id="branding" role="banner">
				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
				<<?php echo $heading_tag; ?> id="site-title">
						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
				</<?php echo $heading_tag; ?>>
				<div id="site-description"><?php bloginfo( 'description' ); ?></div>

					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
							has_post_thumbnail( $post->ID ) &&
							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
							$image[1] >= HEADER_IMAGE_WIDTH ) :
						// Houston, we have a new header image!
						echo get_the_post_thumbnail( $post->ID );
					elseif ( get_header_image() ) : ?>
						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
					<?php endif; ?>
			</div><!-- #branding -->

			<div id="access" role="navigation">
			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
			</div><!-- #access -->
		</div><!-- #masthead -->
	</div><!-- #header -->

	<div id="main">

Open in new window

Dave BaldwinFixer of Problems
Most Valuable Expert 2014

It appears you're on Windows hosting and looking in one of the '_vti_cnf' directories.  That is not code for Wordpress but something the server uses.  Nothing in the '_vti_cnf' directories is used by Wordpress.
WordPress really should be hosted on a linux/unix server to avoid the problem Dave just mentioned


so, how can I locate the real header.php that its actually used by wordpress and then try to modify it?

Im checking the header.php from my WP admin panel, Ill provide a pic, this is what I see when I click on header.php from my WP admin panel


EDIT IMPORTANT: Ive checked the header.php in my server using my FTP and there it is as Jason said, but how can I restore its original content to my WP panel so I can edit it using the WP panel (and see the real content instead of that gibberish), so I dont have to go to the FTP everytime??
I think you are going to have to host it on a Linux server. See if your host offers both, and if it can be switched.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Wordpress works fine on Windows IIS web server if it is configured with PHP and MySQL.  But IIS adds extra directories when it has FrontPage extensions and it looks like you are looking at them and not the main PHP files.


for the time being, i rather not switch hosts just because of this. I'll try to edit it in situ in the server itself,. but to avoid risks I'd like to first create a child theme, do you know of any easy to follow step by step guide of how to create a child theme?

Don't talk to me.
This one is on us!
(Get your first solution completely free - no credit card required)
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

I just looked at my demo copy of Wordpress on Windows XP / IIS 5.1 and it shows the same 'vit' things in the Editor under Appearance.  However, the 'real' "header.php" has the proper code in it and the site is running.  That tells me that something in Wordpress is getting the wrong directory, the '_vti_cnf' directory.


Dave I wonder if in my case its because I installed a spanish traaslation for my spanish users, perhaps that overwrote in the WP panel the original file, though as you said, the real header.php still is there in the actual server, though you cannot access it through the WP panel.

thanks jason, Ive quickly skimmed through it and I have a doubt: if I only want to modify the header file, how should I go about it? obviously Id have to create in my child folder the style.css, but what other file? the header I suppose? and do I have to link this new header in the style file?

finally, if my central upper banners name was "hawaii.jpg" and I wanted to link it to my website, i.e: (fictional) www.hawaiisgreat.com, what would be the entire code in the header.php?

Im willing to put some time and effort into learning more about php and coding for my blog, but my problem right now is time, I've spread myself too thin for my actual current abilities and knowledge and I still have to fullfil a certain deadline, so thats why I ask for so many directions and help.

Dave BaldwinFixer of Problems
Most Valuable Expert 2014

I don't know why the Theme editor is bringing up the wrong pages.  In my demo install of Twenty-Ten, line 65 in 'header.php' gets the image name from some function and populates the details of an <img> tag.  You would have to put an anchor around that image tag.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.