3 Replies - 7615 Views - Last Post: 26 September 2011 - 02:01 AM Rate Topic: -----

#1 markyeoj  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 11-September 11

Fatal error: Call to undefined function get_header()

Posted 25 September 2011 - 07:41 PM

Hello there, I need a help I can't open my index.php, every time I try there always an error that says

Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\phg\index.php on line 1

although the header.php is exisiting in the folder.. Any Idea please.
Is This A Good Question/Topic? 0
  • +

Replies To: Fatal error: Call to undefined function get_header()

#2 markyeoj  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 27
  • Joined: 11-September 11

Re: Fatal error: Call to undefined function get_header()

Posted 25 September 2011 - 07:50 PM

ok, I'll show you the codes
of the header.php
<!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">
<head profile="http://gmpg.org/xfn/11">
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Post Topic <?php } ?> <?php wp_title(); ?></title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<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="/favicon.ico" type="image/x-icon" />
<meta name="Theme" content="Timeless" />
<meta name="Author" content="Roam2Rome" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>

<?php wp_head(); ?>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17815259-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="css/images/scale1.0.jpg"
var image2=new Image()
image2.src="css/images/header.jpg"
var image3=new Image()
image3.src="css/images/scale2.1.jpg"
//-->
</script>


<style type="text/css">
div.img
  {
  height:auto;
  width:auto;
  float:left;
  position:absolute; TOP: 119px; RIGHT:585px; WIDTH:50px; HEIGHT:50px
  }
  div.img1
  {
  height:auto;
  width:auto;
  float:left;
  position:absolute; TOP: 90px; RIGHT:505px; WIDTH:50px; HEIGHT:50px
  }
  div.img2
  {
  height:auto;
  width:auto;
  float:left;
  position:absolute; TOP: 103px; RIGHT:420px; WIDTH:50px; HEIGHT:50px
  }
</style>

</head>
<body>

<?php if(function_exists('wp_admin_bar')) wp_admin_bar(); ?>

<div class="img">
  <a target="_blank" href="klematis_big.htm">
  <img src="css/images/request.png" alt="" width="" height="" />
  </a>
</div>
<div class="img1">
  <a target="_blank" href="klematis_big.htm">
  <img src="css/images/gc1.png" alt="" width="" height="" />
  </a>
</div>
<div class="img2">
  <a target="_blank">
  <img src="css/images/get1.png" alt="" width="" height="" />
  </a>
</div>

<div id="c_wrapper">
<div id="c_container">
<div id="c_header">
<div class="top_header"></div>
<div class="topmargin_header"><map name="FPMap0">
<area href="http://planet-hugger.com/contact-us/request-booking/" shape="rect" coords="717, 80, 754, 156">
<area href="http://planet-hugger.com/green-cleaning-products/gift-certificate/" shape="rect" coords="783, 82, 846, 158">
<area href="http://planet-hugger.com/contact-us/get-estimate/" shape="rect" coords="849, 83, 938, 159" alt="planet hugger" />
<area href="http://planet-hugger.com" shape="rect" coords="19, 2, 194, 159" alt="planet hugger" />
</map>
	

<img border="0" src="css/images/Copylogo1.png" usemap="#FPMap0" width="1003" height="175"><span></div>
<div class="content_header">
<div class="header_logo">

</div>

</div>
<a href="javascript:slidelink()">
<img src="css/images/scale2.1.jpg" name="slide" border="0" width="" height="" /></a>
<script type="text/javascript">
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",1800)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location=""
else if (whichimage==2)
window.location=""
else if (whichimage==3)
window.location=""
}
//-->
</script>
<div id="c_navigator">
<div class="navigator">

<div role="navigation" id="access">

</div>
</div>
</div>


and here is the code oh index.php
<?php get_header(); ?>
<div id="c_content">
 
<div id="post_entry">
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<div class="post_meta" id="post-<?php the_ID(); ?>">
<div class="post_top"></div>
<div class="post_index">
<div class="post_title">
<div class="calendar">
<p class="date"><?php the_time('j'); ?></p>
<p class="month"><?php the_time('M'); ?></p>
</div>
<div class="post_info">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<span class="author">Posted by <?php the_author_posts_link(); ?>&nbsp;<?php edit_post_link(__(' Edit'), '|', ''); ?></span>
</div>
</div>

<div class="post_content">
<?php the_content("<br />" . "continue reading&nbsp;" . "&quot;" . the_title('', '', false) . "&quot;"); ?>
</div>
<?php if ( function_exists('the_tags') ) { the_tags( '<p>Tags: ', ', ', '</p>'); } ?>
<div class="post_comment_counter">
<span class="category">Published in <?php the_category(', ') ?>   |   <a href="<?php comments_link(); ?>"><?php comments_number('no comment','1 comment','% comments'); ?></a></span>
</div>

</div>
<div class="post_bottom"></div>
</div>
<div class="clear_content"></div>

<?php endwhile; ?>

<div class="post_nav"><?php if(function_exists('wp_pagenavi')): ?> <?php wp_pagenavi(); ?><?php else : ?><?php posts_nav_link(); ?>
<?php endif; ?></div>

<?php else: ?>

<h3>The Post Has Been Deleted...</h3>

<?php endif; ?>

</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>



Was This Post Helpful? 0
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3717
  • View blog
  • Posts: 5,979
  • Joined: 08-June 10

Re: Fatal error: Call to undefined function get_header()

Posted 25 September 2011 - 10:49 PM

Hey.

Well, the error message pretty much says it all. You are calling an undefined function, called get_header() on line #1 of your index.php file.

Where is the get_header() function defined? Could you show us the code for that function?

If you are trying to include the header.php file in the index.php file, you should be doing include 'header.php';. Just calling a function called get_header() will not include the file unless it is created to do so.

This post has been edited by Atli: 25 September 2011 - 10:52 PM

Was This Post Helpful? 0
  • +
  • -

#4 LiDoNg_9_0  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 159
  • Joined: 03-September 09

Re: Fatal error: Call to undefined function get_header()

Posted 26 September 2011 - 02:01 AM

please include your library where you put function get_header(). exmaple include("mylibrary.php");
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1