Call to undefined function get_header()
-
First and foremost, I’m in way over my head. I really don’t know what I’m doing here (surprise, suprise, right?!) but through lots of research and trial and error I have the front page of my site up and running on my localhost.
All runs and looks fine on the front page. Its a simple page that has links in the header, a swf animation and a call to get the most recent 2 posts. All of that works wonderfully, but as soon as I press one of my links (the link to “Press” in this instance) everything goes to hell. I get the following message: Fatal error: Call to undefined function get_header() in C:\W\WD\xampp\htdocs\wp-content\themes\MaybeMarquis\press.php on line 7
From research I’ve done it appears that this sort of thing happens when you start moving files from one place to another and editing files in the root and not in the theme file… But I haven’t done that. The files in root are 100% unedited and the only thing I’ve touched is stuff in the MaybeMarquis file. Any chance someone can give me a hand here? I’m a tad frustrated and would be grateful for the assistance!!
Thanks in advance.
header.php (Works with index.php :: Location: wp-content\themes\MaybeMarquis\)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title> <?php wp_title('-',true,'right'); ?> <?php bloginfo('name'); ?> </title> <link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <div id="site"> <div id="header"><a href="index.html"><img id="logo" src="/wp-content/themes/MaybeMarquis/images/marquis-logo.gif" width="203" height="52" alt="Marquis Energy"></a> <div id="nav"><ul class="navigation"> <li class="navigation"><a href="energy.html" class="grey-green">ENERGY</a></li> <li class="navigation"><a href="manage/index.html" class="grey-blue">MANAGEMENT</a></li> <li class="navigation"><a href="grain/index.html" class="grey-orange">GRAIN</a></li> <li class="navigation last"><a href="marine/index.html" class="grey-lightblue">MARINE</a></li> </ul> </div> <div class="right"><ul class="navigation"><li class="navigation"><a href="contact.html" class="grey-white">CONTACT</a></li><li class="navigation"><a href="careers.html" class="grey-white">CAREERS</a></li><li class="navigation last"><a href="/wp-content/themes/MaybeMarquis/press.php" class="grey-white">PRESS</ul></div> </div> <!--Navbar start--> <div class="topnavigationArea"> </div> <!--Navbar end-->
index.php (Works :: Location: wp-content\themes\MaybeMarquis\)
<?php get_header(); ?> <script src="js/swfobject.js" type="text/javascript" language="javascript" ></script> <script src="js/swfs_divs.js" type="text/javascript" language="javascript" ></script> <div class="contentArea"> <div class="container"> <div class="contentLeft"> <div id="swf-globe-plain"><img class="middle" src="wp-content/themes/MaybeMarquis/images/globe-plain.gif" width="350" height="350" alt="globe"></div> </div> <div class="contentRight"> <?php $args = array( 'numberposts' => 2, 'category' => 6,); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content(); ?> <?php endforeach; ?> </div> </div> </div>
press.php (everything has gone to hell! :: Location: wp-content\themes\MaybeMarquis\)
<?php get_header(); ?> <script src="js/swfobject.js" type="text/javascript" language="javascript" ></script> <script src="js/swfs_divs.js" type="text/javascript" language="javascript" ></script> <div class="contentArea"> <div class="container"> <div class="contentLeft"> <div id="swf-globe-plain"><img class="middle" src="wp-content/themes/MaybeMarquis/images/globe-plain.gif" width="350" height="350" alt="globe"></div> </div> <div class="contentRight"> <?php $args = array( 'numberposts' => 2, 'category' => 10,); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a>"><?php the_title(); ?></a></h2> <?php the_content(); ?> <?php endforeach; ?> </div> </div> </div>
- The topic ‘Call to undefined function get_header()’ is closed to new replies.