Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i'm trying to replace news system on my website with posts from wordpress site. I have main site in (example) /var/www/site and working Wordpress blog on /var/www/site/blog

Tried to do that: http://codex.wordpress.org/Integrating_WordPress_with_Your_Website and neither wp-load nor wp-blog-header are working. I'm getting redirection to wp-install.

Strange thing is that php file put into main site main dir is working properly, but any try to require wp files inside main site structure (on init stage or on displaying page header) are failing.

What i am doing wrong? It's all happening on 3.4.1 WP version.

Cheers

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Providing this will work if it's all on the same server.

This is the PHP I use at the top of non-wordpress site.

define('WP_USE_THEMES', false);

require('/home/sites/example.co.uk/www/wp/wp-load.php');

Obviously you just need to put your server path to the wp-load.php file.

Just write your news query and loop it should feed in the content to your non-wordpress site.

share|improve this answer
    
hmm... will try this one... maybe i'll need two wp-loads for both blog and site will work. Will tell :) –  yasiu071 Jun 30 '12 at 12:45
    
It looks that WP is connected now, but there are some conflitcs with DB handlig - between original site and WP... gotta do some major tweaking here :) –  yasiu071 Jun 30 '12 at 13:16
    
is your original site also wordpress? –  Joshc Jun 30 '12 at 13:46
    
No, my original site is CMS somebody created and i'm trying to figure it out. But i solved this database problem - both WP and this site were using same variable names for establishing DB connection. Easy change and it's working now :) –  yasiu071 Jul 1 '12 at 6:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.