My website is designed with WordPress. Some theme pages have a custom made PHP script for booking things, which I want to refactor in CodeIgniter, to get more flexibility. Questions :
1) how to use CI functions in WP with CI’s routing system ?
Do I have to make a CI page index.php/controller/page1/ and then call it in WordPress ?
2) Do I have to use CodeIgniter “views” system or WordPress “theme pages” to get my result ?
Thanks
I used the following.
My goal is to use CodeIgniter for some pages, and leave the other pages in WordPress untouched. I only have a few steps to do it :
Copy CI folder at the WordPress root
Modify the « index.php » of CI to add an include which will add WP functions to CodeIgniter :
Once this line added, WordPress functions will be usable in CodeIgniter ; they will be used mainly for views.
Modify the .htaccess of WP to not rewrite CI’s URLs :
After this line :
Add this line :
Then CI views can use WP functions.
If you have an CI application that uses login session you have to modify the “load.php” file (from “wp-includes” WP folder). To do that follow the PhilB’s answer from this link. For a complete explanation follow this post.
View more: How to Integrate CodeIgniter with WordPress