Solved

why is this image not showing up in WordPress?

Posted on 2013-05-30
5
323 Views
Last Modified: 2013-06-02
Friends,

A weird thing is going on. The logo image does not display in this web page:

http://palladian.ebwebwork.com/

I have selected the correct theme, and chosen what I think is the correct path for the image.

Other images that use the same path display properly -- eg. the header background image.

What am I doing wrong here? I have been working on this for hours. I am grateful for any advice.

Eric

header.php file:

<?php
/**
 * Header
 *
 * Setup the header for our theme
 *
 * @package WordPress
 * @subpackage Foundation, for WordPress
 * @since Foundation, for WordPress 4.0
 */
?>

<!DOCTYPE html>
<!--[if IE 8]> 				 <html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->

<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />

<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />

<title><?php wp_title(); ?></title>

<?php wp_head(); ?>

</head>

<body <?php body_class(); ?>>
<!--- begin grid --->
<div class="grid">

<!-- begin navrow -->
<div class="navrow">

	<nav class="top-bar">
<!--		<ul class="title-area">
			<li class="name"><h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo('name'); ?></a></h1></li>
			<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
		</ul>-->
		<section class="top-bar-section">
			<?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'menu_class' => 'left', 'container' => '', 'fallback_cb' => 'foundation_page_menu', 'walker' => new foundation_navigation() ) ); ?>
		</section>
	</nav>
</div>    
    <!-- /navrow -->

<!-- begin brandingrow -->
<div class="brandingrow">
<a href="/"><img src="img/imageSmartLogo.png" width="453" height="62" alt="ImageSmart" /></a>
</div>    
    <!-- /brandingrow -->



	<?php $header =  get_header_textcolor();
	if ( $header !== "blank" ) : ?>
	<header class="site-header" <?php $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?> style="background:url('<?php echo esc_url( $header_image ); ?>');" <?php endif; ?>>
		<div class="row">
			<div class="large-12 columns">
				<h2><a style="color:#<?php header_textcolor(); ?>;" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'description' ); ?></a></h2>
			</div>
		</div>
	</header>
	<?php endif; ?>



<!-- Begin Page -->
<div class="row">

Open in new window

0
Comment
Question by:Eric Bourland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39208890
You're loading the image with:

<img src="img/imageSmartLogo.png"

which resolves to:

http://palladian.ebwebwork.com/img/imageSmartLogo.png

when the page is loaded.  So...where is the img folder in your structure?
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 39208923
On the server, the path is:

/public_html/wp-content/themes/drewsymo-Foundation-2ef5908/img/imageSmartLogo.png

This is the path to the "Foundation" theme.

In WordPress I have selected the "Foundation" theme ... so should
http://palladian.ebwebwork.com/img/imageSmartLogo.png resolve correctly?
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 39208965
I am also curious about this code -- which seems to request a header image?

	<?php $header =  get_header_textcolor();
	if ( $header !== "blank" ) : ?>
	<header class="site-header" <?php $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?> style="background:url('<?php echo esc_url( $header_image ); ?>');" <?php endif; ?>>
		<div class="row">
			<div class="large-12 columns">
				<h2><a style="color:#<?php header_textcolor(); ?>;" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'description' ); ?></a></h2>
			</div>
		</div>
	</header>
	<?php endif; ?>

Open in new window


Should I use, or disregard that code? I am trying hard to work with, not against, WordPress. =)

Thank you again.

Eric
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39209453
In WordPress I have selected the "Foundation" theme ... so should
http://palladian.ebwebwork.com/img/imageSmartLogo.png resolve correctly?

Nope. It would be:

http://palladian.ebwebwork.com/wp-content/themes/drewsymo-Foundation-2ef5908/img/imageSmartLogo.png

Should I use, or disregard that code? I am trying hard to work with, not against, WordPress. =)

Good guess but not quite.  The get_header_image() function works specifically with the banner image found in Appearance | Themes (and if the theme supports it).

What you really want to do is use a WordPress template variable to get the path to the current theme folder:

<img src="<?php bloginfo('template_directory'); ?>/img/imageSmartLogo.png" />

http://codex.wordpress.org/Function_Reference/bloginfo
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 39214766
Jason, the correct path was:

http://palladian.ebwebwork.com/wp-content/themes/drewsymo-Foundation-2ef5908/img/imageSmartLogo.png. Going forward I will follow this example.

Thank you again for all of this very useful advice.

Hope your weekend is going well.

Eric
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress  featured images 3 36
Wordpress Security 29 110
Set a time limit on Wordpress Cookie function. 3 51
Wordpress -  Updating All Posts on Website 3 93
Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question