|06-07-2009, 01:37 AM||#1|
I like monkeys
Join Date: Jul 2003
Location: The South
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...
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?
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
|06-07-2009, 02:50 AM||#2|
Barefoot on the Moon!
Join Date: Aug 2002
Location: Northeastern USA
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.
|Thread Tools||Search this Thread|
|Display Modes||Rate This Thread|