Skip to main content

Posts

Showing posts from December, 2017

Integrate Wordpress in Codeigniter

Step 1: Download the Wordpress framework from wordpress.org Step 2:  Copy the Wordpress folder and paste into the Codeigniter root folder Step 3: Modify the "index.php" of Codeigniter and add Wp function to Codeigniter Search this code "require_once BASEPATH.'core/CodeIgniter.php';" Then, Add the below code above this code. "require_once('[WORDPRESS FOLDER NAME]/wp-blog-header.php');" WORDPRESS FOLDER NAME = Name of the Wordpress root Folder eg: blog Step 4: Create Datebase Install Wordpress by run url "localhost/[CODEIGNITER FOLDER NAME]/[WORDPRESS FOLDER NAME]" CODEIGNITER FOLDER NAME = Name of the Codeigniter root Folder Step 5: Blog Post Fetch Query for codeigniter home page <?php ... $BlogPosts = new WP_Query('showposts=3'); if($BlogPosts->have_posts()): while($BlogPosts->have_posts()) : $BlogPosts->the_post(); the_title(); the_content(); endwhile; endif; ... ?> Source: Youtube