简体   繁体   中英

Display a Wordpress Page on an External Site

Similar to posts, I'd like to know how to display a published Wordpress page on to an external site.

A client wants to use the CMS to create the content, but some content is more suited for the main site (Wordpress is installed on a subdomain).

Okay, solved it myself - rather easy TBH.

I'm going to be bold and say this can go in any PHP file.

<?php
require('WORDPRESS-INSTALL/wp-blog-header.php');

$page_data = get_page(pageID);
echo $page_data->post_content;
?>

The first part needs to link to the WordPress file. PageID is the ID for the page you want to display.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM