Welcome Guest, Not a member yet? Register   Sign In
site_url function collision with Wordpress
#1

Hi,
I've used CI for many years now for my application and have Wordpress running on the same site for a blog. Problem has always been that both Wordpress and CI use the same function site_url(). It would be great if this could be resolved in version 4.

Many thanks, Alan
Reply
#2

(07-18-2017, 07:50 PM)koeninger Wrote: Hi,
I've used CI for many years now for my application and have Wordpress running on the same site for a blog. Problem has always been that both Wordpress and CI use the same function site_url(). It would be great if this could be resolved in version 4.

Many thanks, Alan

This should never be a problem, and if it is you are attempting to run both applications in a single request. I'm guessing this is very uncommon, as there are better ways to run both CI and WordPress simultaneously without loading them both. What exactly are you doing?
Reply
#3

Hi,
I am using CI to handle the page templating, but using Wordpress to make the content editable (via the CMS). Otherwise I have to have two sets of headers, footers etc. I only load Wordpress for one section on the site and want to avoid duplication.
Reply
#4

(07-19-2017, 12:35 AM)koeninger Wrote: Hi,
I am using CI to handle the page templating, but using Wordpress to make the content editable (via the CMS). Otherwise I have to have two sets of headers, footers etc. I only load Wordpress for one section on the site and want to avoid duplication.

If WordPress is never actually displaying the content, and instead you are displaying all content with CodeIgniter, the best solution is to use a subdomain for WordPress, like content.example.com. This lets you use the CMS you desire, and then you just create a custom model(s) for CI so it can go get the content and display it. I've done this a few times. Just share a database between the two apps.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB