如何将WordPress模板与CodeIgniter集成 [英] How to integrate WordPress template with CodeIgniter

查看:191
本文介绍了如何将WordPress模板与CodeIgniter集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何整合CodeIgniter和WordPress,以便将WordPress博客的
的外观和感觉/模板传递给CodeIgniter创建的页面?

How can CodeIgniter and WordPress be integrated such that the look and feel/template of the 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 can assist you in integrating the design.

这篇关于如何将WordPress模板与CodeIgniter集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆