问题描述
如何整合CodeIgniter和WordPress,以便将WordPress博客的
的外观和感觉/模板传递给CodeIgniter创建的页面?
How can CodeIgniter and WordPress be integrated such that the look and feel/template ofthe WordPress blog is carried over to the CodeIgniter-created pages?
推荐答案
第一步是在自己的目录中移动CodeIgniter和WordPress文件。
First step is to move CodeIgniter and the WordPress files in their own directory.
之后,将以下行放在CodeIgniter的 index.php
文件的顶部。根据需要将路径更改为 wp-blog-header.php
以指向您的WordPress的根目录。
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();
?>
其他帮助函数也可以在WordPress的文档中找到,
可以帮助你集成设计。
Other helper functions can also be found in WordPress's documentation which canassist you in integrating the design.
这篇关于如何将WordPress模板与CodeIgniter集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!