Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate WordPress template with CodeIgniter

How can CodeIgniter and WordPress be integrated such that the look and feel/template of the WordPress blog is carried over to the CodeIgniter-created pages?

like image 777
Ali Avatar asked Aug 10 '09 09:08

Ali


1 Answers

First step is to move CodeIgniter and the WordPress files in their own directory.

After that, put the following line at the top of your CodeIgniter's index.php file. Change the path to wp-blog-header.php as needed to point to your WordPress's root directory.

<?php     require('../wp-blog-header.php'); 

Then, you can use the following functions inside your views:

<?php     get_header();     get_sidebar();     get_footer();     ?> 

Other helper functions can also be found in WordPress's documentation which can assist you in integrating the design.

like image 78
Ali Avatar answered Sep 22 '22 13:09

Ali