[Webinar] Streamline your web hosting managementRegister Today


Wordpress: Changing the header.php only effect the home page

Posted on 2010-03-23
Medium Priority
Last Modified: 2012-05-09
I'm using wordpress for my website. I wanted to add some flash to my header so i created everything i wanted and i went into the Header.php file and insterted the flash. On the home page, everything looks fine. The flash file is there and it does what it is supposed to do. However, when i go into any other page on the website, the area where the flash is supposed to be is just white. Nothing else happens, no Red X.... Nothing.

I'm not sure what i could be doing wrong because all the pages call for the header.php using
<?php get_header(); ?>

I've made other changes to the header, not having to do with flash, and they replicate across all other pages like they are supposed to.

Any ideas on what can cause this?

Thanks in advance
Question by:jkpc21
  • 2
  • 2
LVL 31

Expert Comment

ID: 28374343
Are you calling the Flash file with relative links?  The base url changes as your navigate a Wordpress site and /flash/flash.swf won't always point to the same directory.

I usually add the base tag to my Wordpress sites to solve problems like this.

Try putting this inside your
<base href="<?php bloginfo('siteurl'); ?>" />

Open in new window


Author Comment

ID: 28379145
Using absolute paths, it still showed on the home page as i would expect it, but on all the other pages, rather than white it was now showing all black where the flash file is supposed to be.

This code that you gave me: <base href="<?php bloginfo('siteurl'); ?>" />
should i put this in the <head> </head>  of the header.php file?
LVL 31

Expert Comment

ID: 28453989
Yes that is where it goes, but if you are using absolute paths that isn't the problem.

Maybe if you post the code to your header.php file and the Source Code from the page that is having the problem, there will be a clue.

Accepted Solution

jkpc21 earned 0 total points
ID: 28463796
The first code is the header.php
The version of header.php attached does not use the absolute path.

The second code is the page.php page and is where i'm seeing the empty space where the flash is supposed to be

<!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" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

<!-- leave this for stats -->
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<!--[if IE 6]>
    <style type="text/css"> 
    body {
        behavior:url("<?php echo get_option('home'); ?>/wp-content/themes/gandhi/scripts/csshover2.htc");

<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'); ?>" />

<link rel="icon" href="<?php echo get_option('home'); ?>/wp-content/themes/gandhi/images/favicon.ico" />
<link rel="shortcut icon" href="<?php echo get_option('home'); ?>/wp-content/themes/gandhi/images/favicon.ico" />

<script type="text/javascript" src="<?php echo get_option('home'); ?>/wp-content/themes/gandhi/scripts/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo get_option('home'); ?>/wp-content/themes/gandhi/scripts/js/easySlider1.5.js"></script>
<script type="text/javascript" src="<?php echo get_option('home'); ?>/wp-content/themes/gandhi/scripts/js/menu.js"></script>
<script type="text/javascript">
   auto: true,
   continuous: true,
   pause: 3000
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<div id="page" class="clearfloat">
<div id="head">
	<div id="head-top" class="clearfloat">									
		<ul id="menu" class="left clearfloat">
 			<?php wp_list_pages('sort_column=menu_order&title_li='); ?>
		<?php include (TEMPLATEPATH . '/searchform.php'); ?> 		
	<div id="head-bottom">
	<img style="float:left; padding-left:10px;" src="/wp-content/themes/gandhi/images/globe.gif" alt="name"/>
<div class="mainheaderad">
<object width="255" height="85">
<param name="movie" value="BannerRotatorComplete.swf">
<embed src="BannerRotatorComplete.swf" width="255" height="85">

		<div id="headbottom-center-text">
			<div id="headbottom-center-title">
				<strong><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></strong>	
                            			<div id="headbottom-center-body">
				<?php bloginfo('description'); ?>

Page Template (page.php)

<?php get_header(); ?>
<?php include(TEMPLATEPATH . '/l_sidebar.php'); ?>
	<div id="content">
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<div class="post" id="post_<?php the_ID(); ?>">

	<span class="breadcrumbs">
	<? if (is_front_page()) 
		{ ?> 
			<a href="<?php echo get_option('home'); ?>/">Home</a>
	 <? } 
	    { ?>
			<a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; <?php the_title(); 
	    } ?>
	<h2 class="title"><? if (is_front_page()) { echo ""; } else { the_title(); }  ?></h2>
		<div class="entry clearfloat">
		<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

		<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

	<?php //edit_post_link('Edit this entry.', '<p>', '</p>'); ?>

	<?php endwhile; endif; ?>


<?php include(TEMPLATEPATH . '/r_sidebar.php'); ?>
<?php get_footer(); ?>

Open in new window


Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

640 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