Using WordPress header outside of WordPress
-
I have searched and looked through every seemingly relevant hit on this, but nothing seems to work for my particular situation. I am simply trying to load my WordPress header on pages in a non-Wordpress script.
I have put this code in a file:
<?php require_once(‘/home/lisamac/www/www/sandbox/wp-load.php’);
get_header(); ?>I am using a gallery script that allows me to use an external file for my header. I have saved the above file to the root of this gallery script and am entering that file name in the space provided for the external file.
Two problems.
First, the logo is not where it belongs. I am unable to find anything that conflicts with the WordPress css so I can’t quite figure out why it is where it is. It should be like this:https://www.lisamacphotography.com/sandbox
Instead, it looks like this:
https://www.lisamacphotography.com/galleryAlso, there is a database table error. It seems like the gallery script is now looking in the WordPress database for it’s information rather than the gallery script’s database.
Nothing from the gallery script is loading with the WordPress header call in place.
I appreciate any help you can give. I think this is in the right place, but if not, please let me know and I’m happy to move it.
Thanks!
- The topic ‘Using WordPress header outside of WordPress’ is closed to new replies.