Welcome Guest, Not a member yet? Register   Sign In
[solved] CI / WP integration woes
#1

[eluser]CroNiX[/eluser]
So on this current project, we have built a site around and existing wordpress blog. Wordpress will still be used for the blog portion and is installed in /blog. On my CI homepage controller, I need to pull some recent articles from the blog, so I instantiated the wp from within my ci index.php as the first line.

Code:
if($_SERVER['REQUEST_URI'] == '/')
{
    require('blog/wp-blog-header.php');
}
I only want to instantiate it if its on the homepage as thats the only place it will be used.

This works fine, now I can use wp commands to get posts, etc. from wp.

The problem happens from any link generated using CI (anchor() command) on that page now. It works fine without instantiating WP, but when it does all links generated by ci is now prefixed by /blog/whatever.

So if the link is supposed to be www.mysite.com/help it now shows up as www.mysite.com/blog/help. This using:
Code:
anchor('help', 'Help Page');

Does anyone know what can be causing this and if there is a solution? Everything else works just great except this one thing which is perplexing me. Why would having the wp object instantiated cause CI to mess up urls?

Thanks,
CroNiX


Messages In This Thread
[solved] CI / WP integration woes - by El Forum - 08-20-2009, 05:15 PM
[solved] CI / WP integration woes - by El Forum - 08-20-2009, 07:25 PM
[solved] CI / WP integration woes - by El Forum - 08-22-2009, 04:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB