0

I have developed the CRM based web application what i need to do is to integrate the wordpres with my CI first i have the problem when i include the main WP file

require('./wp-blog-header.php');

in my one of the CI view file the error i was getting that function site_url() conflicts this function is the base function of both WP and CI ,although i found a solution to include the WP file in the main index.php file of CI but there is uncertainity too that after this the session library of CI stops working is.

How to show the posts of WP in the footer of my CRM?

4

1 回答 1

0

在我的 CodeIgniter 视图中使用 include 或 require 时,我确保我链接到的文件位于 CodeIgniter 应用程序文件夹之外,因为由于一些权限问题,我无法在那里使用文件。我的解决方案是在我的网络目录中保留一个文件夹。您也不能在这里使用 base_url 或 site_url CodeIgniter 函数,因为您想要获取服务器路径而不是文件的网址。所以你可以使用 php 变量$_SERVER['DOCUMENT_ROOT']来返回你的 web 目录的根目录。它可能看起来像这样:

 require($_SERVER['DOCUMENT_ROOT'].'wp-blog-header.php');

如果 wp-blog-header.php 在您的网络根目录中,这将起作用。

于 2012-08-09T18:33:10.797 回答