WordPress inside Codeigniter


WordPress is great CMS but it has it’s limitations and it is not suitable for doing complex stuff, especially if you want your database to be clean. Wordpress is blogging platform, so it isn’t meant for big systems and I guess developers should keep this in mind when using it.
On the other hand Codeigniter is one of the best if not the best PHP framework out there, and it’s good pick for development of big systems. It is based on MVC pattern and even has HMVC support so if you know what you’re doing you basically have no limitations.

You don’t want to create new news system when perfect one is already available. So you can use WordPress as plugin for Codeigniter project and cut your development time.

So how to do this:

  1. Put new Codeigniter installation in the root of WordPress installation (or vice versa).
  2. Go to index.php of your Codeigniter.
  3. Put following line of code at the beginning of index.php

Now you can call any WordPress function or WordPress plugin function from inside of Codeigniter.


1 Response

  1. Vani Strong 18. July 2013. / 17:27

    require_once $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-load.php’;

    very useful:-)

Leave a Reply

Your email address will not be published. Required fields are marked *