Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 06-07-2009, 12:37 AM   #1
I like monkeys
 
tomster2300's Avatar
 
Join Date: Jul 2003
Location: The South
Posts: 2,526
PHP include error

I want to pull and display my wordpress blog in an external page, outside of the wordpress directory. I thought it was possible to do so through...

PHP Code:
<?php
include ("../wordpress/wp-content/themes/tremor/index.php");
?>
but instead I get the following error -

Fatal error: Call to undefined function get_header() in /home/mcgaheet/domains/tommymcgahee.com/public_html/wordpress/wp-content/themes/tremor/index.php on line 1

Is it failing because it's assuming that the other php pages like header.php are in the same directory as the page I'm trying to display the blog on? I thought I could just include the index.php page and it would pull everything else from the correct directory (since index.php is not moving from the original directory, but only being included...).

I hope this makes sense. Does anyone know how to fix this?

Thanks!
__________________
Desktop: Intel i7 920--GA-x58-UD3R--Corsair XMS 12GB DDR3 1600mhz--Diamond Radeon HD 7850--PC Power & Cooling Silencer 750w psu--Samsung 830 128GB SSD--1TB RAID 0--Lite-on DVD-DL burner--Cooler Master HAF case--Windows 7 Professional 64-bit

Laptop: Apple Macbook Pro 13" 2011
tomster2300 is offline   Reply With Quote
Old 06-07-2009, 01:50 AM   #2
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,805
You'll have to write your own code to pull the correct data to display from the wordpress database, find a code splice that'll do it, get the data from the RSS feed, or display the blog in an iframe.

Trying to do an include like that simply won't work. Paths and function calls go missing, as you've discovered. Wordpress themes are just that...themes. They require the rest of wordpress to work. By including just the theme's index page, you're missing the rest of wordpress. So, any calls to wordpress functions (such as get_header) return with a "not found/defined" error.
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
Force Flow is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -5. The time now is 09:24 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.1