开发者

Wordpress theme code in simple PHP website

I have a php website, in which I have used a lot of jquery plugins and accessing another database for header and footer contents dynamically.Now I have to add a blog for which I am checking wordpress. I can create the theme,开发者_StackOverflow中文版 but cannot access the header and footer dynamic contents from other DB. Is there some other to access the wordpress theme loop and other theme functions in my simple php pages? If no then any suggestion about other simple php blog script to add in the website with SEO support please.

Thank you


You can include files as you wish in a Wordpress template using include() or require(). Just put your PHP files with your template files and you should be good to go.

Here's how you can forego Wordpress entirely and display something from your old website, if your old website now lives inside of your template folder:

add_action('template_redirect', 'show_old_page');
function show_old_page() {
    if( $_GET['old_page'] == 'pagename' ) {
        include( TEMPLATE_PATH . 'oldpage.php' );
        exit;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜