jvaidya
Member
Posted 4 months ago #
Hey Guys,
I am new to PHP and I have been working to edit a preexisting WP theme to my liking, and I have run into a roadblock. I found where to insert my logo into the header.php file and have it so when you click the image it links to my homepage and, it works in firefox. However, when I open the page in my IE8 browser the image shows up as a tiny box with an x over it (and the link still works). Here's what I have:
<div class="col-left">
<h1>
"><img src="<?php bloginfo('template_directory'); ?>/img/Logo2.jpg" /></h1>
</div>
Any thoughts? I appreciate any and all help you can provide. Thank you!
Can you post a link?
Also, what's with the "> at the beginning of the line with the image?
jvaidya
Member
Posted 4 months ago #
Sorry, for some reason my whole txt did not paste properly last time. The code I'm using is
'<div class="col-left">
<h1>
">
<img src="<?php bloginfo('template_directory'); ?>/img/Logo3.jpg/>
</h1>
</div>'
The link to the page is http://www.tgstech.com/blog
jvaidya
Member
Posted 4 months ago #
i just tried 10 different ways and the
a href="<?php bloginfo('url'); ?>"
wont post properly
This is what comes before the img tag
Post markup between backticks (`) or highlight it and use the 'code' button to insert the backticks.
The markup is currently looking for an image called "Logo3.jpg" (not Logo2.jpg) in the wp-content/themes/Corpvox_test/img folder. You need to check that the image is in the correct place.
jvaidya
Member
Posted 4 months ago #
<div class="col-left">
<h1>
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/Logo3.jpg" /></a></h1>
</div>
the Logo3.jpg image is in the proper place, I only changed it to see if there was a problem with the previous pic. The image shows up in firefox just not IE.
The correct code should be:
<div class="col-left">
<h1>
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/img/Logo3.jpg" alt="Home" /></a></h1>
</div>
See if that helps.
jvaidya
Member
Posted 4 months ago #
I tried the code, it still works in firefox but not in IE8. Here is the code for the header (taken from the corpvox theme) maybe you can see something I can't:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://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 if (is_home () ) { bloginfo(‘name’); }
elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo(‘name’); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(‘’,true); } ?></title>
<?php wp_head(); ?>
</head>
<body>
<div id="wrap">
<div id="wrap_in">
<div id="top" class="wrap">
<div class="col-left">
<h1>
<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/img/Logo3.jpg" alt="Home" /></a>
</h1>
</div>
<div class="col-right wrap">
<a href="#"><img src="<?php bloginfo('template_directory'); ?>/img/img_rss.gif" width="116" height="46" alt="RSS Feed" /></a>
<a href="#"><img src="<?php bloginfo('template_directory'); ?>/img/img_email.gif" width="115" height="46" alt="Email Feed" /></a>
</div>
</div>
<div id="menu">
<ul>
<?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
<li class="<?php echo $highlight; ?> first"><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
</div>
Sorry I pasted all of this, but I've been working on this for a while and I'm stumped.
jvaidya
Member
Posted 4 months ago #
Still stumped and looking for a wordpress angel to swoop down and save me!
Because Iexplorer can't render CMYK images. (mozilla and opera can, btw, didn't test other browsers)
Change the Jpg to RGB ;) and it will be visible in every browser.
;) greets