• can i make my header be a link as well so you can click it to go back to the home page?

    in my header.php it goes as follows:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
    <meta name="description" content="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>" />
    <meta name="keywords" content="" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
    <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'); ?>" />
    <title><?php bloginfo('name'); wp_title(); ?></title>
    
    <?php wp_head(); ?>
    </head>
    
    <body>
    
    <div id="wrap">
    
    	<div id="top">
    
    		<div id="menu">
    
    		<ul>
    		<?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
    		<li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>"><span>Home</span></a></li>
    		<?php
    		$pages = wp_list_pages('sort_column=menu_order&depth=1&title_li=&echo=0');
    		$pages = preg_replace('%<a ([^>]+)>%U','<a $1><span>', $pages);
    		$pages = str_replace('</a>','</span></a>', $pages);
    		echo $pages;
    		?>
    		</ul>
    
    		</div>
    
    		<div id="search">
    
    		<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    		<div>
    		<input type="text" name="s" id="s" class="field" value="Searching for ?" onfocus="if (this.value == 'Searching for ?') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Searching for ?';}" />
    		<input type="image" src="<?php bloginfo('template_directory'); ?>/img/icon_search.gif" class="submit" name="submit" />
    		</div>
    		</form>
    
    		</div>
    
    	</div>
    
    	<div id="header">
    
    		<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    		<p><?php bloginfo('description'); ?></p>
    
    	</div>
Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter djwesterfield

    (@djwesterfield)

    anything?

    Thread Starter djwesterfield

    (@djwesterfield)

    ??

    You header, as quoted above, already has a link back to the main page just after the H1 tag. so what’s your issue, does not clicking your blogs hame in the header lead back to the home page?

    Have you set the url of your blog in Settings?

    Thread Starter djwesterfield

    (@djwesterfield)

    the url is set in my settings.

    check it: https://www.theowler.com

    it doesnt let me click the header and bring it to the home page

    Your “home” button is already there, at the left top, and it works. So I also don’t get what you mean.

    If maybe you mean you want that image to be a link, yes it can be set. But, on a quick look, it seems it’s used as background. So it’s not as simple as if it was an image inserted into the header. Anyways, you can add a transparent image over it, and use it to link to wherever u feel like.

    Thread Starter djwesterfield

    (@djwesterfield)

    so lets say i want to make a transparent image over it and make a link.

    what would be the steps to do that?

    Ah, k, I think I get what u mean.

    This part of the code isnt appearing:

    <div id=”header”>
    <h1>“><?php bloginfo(‘name’);?></h1>
    <p><?php bloginfo(‘description’); ?></p>
    </div>

    But it comes written on your html:

    <div id=”header”>
    <h1>The Owler</h1>
    <p>Life, Music and Owls.</p>
    </div>

    So it’s there, it just isnt visible. Looks like there’s something misconfigured on your style.css file.

    Get the last part:

    <div id="header">
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p><?php bloginfo('description'); ?></p>
    </div>

    Replace

    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p><?php bloginfo('description'); ?></p>

    for a transparent image image with a link (if that’s what you want), like:

    <div id="header">
    <a href="xxxxxxxxx">
    <img src="images/transparent.gif" width="800" height="100"></a>
    </div>

    Create a transparent image and write its path in “src=….”. Adjust its dimensions according to the size of the area you want to be clickable. Add the URL you want in href=”xxxxxxxxx”.

    ========

    Just notice that by doing this you’ll be removing your blog title and subtitle (the part which isn’t appearing right now anyways), so maybe you prefer to quote the code, instead of removing it:

    <!--
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p><?php bloginfo('description'); ?></p>
    -->

    The arrows will disable that piece of code. The day you want to use it again, just remove the quoting arrows.

    Thread Starter djwesterfield

    (@djwesterfield)

    ok so i tried what you said vangrog

    <div id="header">
    
    <!--
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    		<p><?php bloginfo('description'); ?></p>
    	-->
    <a href="https://www.theowler.com">
    <img src="images/transparent.gif" width="850" height="175"></a>
    </div>
    	</div>

    all it did was shift my header to the left, and there was no link.
    i did make a transparent .gif and i named it “transparent.gif”

    Try removing the style, and center the image:

    <div>
    <p align="center">
    <a href="xxxxxxxxx">
    <img src="images/transparent.gif" width="800" height="100"></a>
    </p>
    </div>

    And adjust its size to make it fit, and not stretch the page.

    Thread Starter djwesterfield

    (@djwesterfield)

    tried it and it didnt do anything.

    <div id="header">
    
    <!--
    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    		<p><?php bloginfo('description'); ?></p>
    
    -->
    <div>
    <p align="center">
    <a href="https://www.theowler.com">
    <img src="images/transparent.gif" width="800" height="100"></a>
    </p>
    </div>
    
    	</div>

    Well, my guess is something is wrong with your template. First the the blog title (added by WP itself), now a simple image you try to add on the header. If you have edited this template, I’d sugest you to throw it all again, install the original template and start it all over again.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How can i post a header link on a modified theme?’ is closed to new replies.