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
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
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.