Codeigniter view in Wordpress

784 views Asked by At

I have a website build with Codeigniter and I need to have a blog. It should be a WordPress so what I decided to do is to add "blog" in my .htaccess and install a WordPress in myweb.com/blog

It works perfect.

Now, I need to change my theme header and footer from the one that I have already in my web.

How can I do it?

I have the view at views/common/header.php, but obviously, I can not load it like this in template/header.php

<?php $this->load->view('common/header');?>  

If I'm not wrong, I should add any code at header.php in my template folder. So, the question is, what should I change or add on it??

Thanks a lot!


UPDATE

I think there should be a helper I could load in codeigniter in order to call that functions on Wordpress

How can I do it?

1

There are 1 answers

0
Swapnil Ghone On BEST ANSWER

You directly cannot call CI view in wordpress file. Inorder to make changes to wordpress header and footer you will need to modify header.php and footer.php file under wordpress theme (wp-content/themes/your_theme_folder). Also make sure that you do not modify wordpress default theme directly as any changes to default theme would be lost during wordpress updates. Best practice is to create child theme and then make your changes over there https://codex.wordpress.org/Child_Themes , here the guide to create child theme.