Quin
Quin

Reputation: 172

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).

Upvotes: 0

Views: 547

Answers (1)

Quin
Quin

Reputation: 172

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.

Upvotes: 2

Related Questions