Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112486

mc_marie on "Include Page Content without Loop"

$
0
0

We are displaying the page content on an archive page in a specific section. You can see it working here on a category-ID.php while the page of desired content is at the main level. However, for several reasons, we want the page of desired content to be a sub-page of Churchs & Organizations.

I have also used this code in other ways when I'm trying to display page content in another page template or something of that sort.

<?php //including text from a page without using the loop! without loop outside of loop page content
		//http://wordpress.org/support/topic/use-text-from-my-word-press-page-elsewhere-on-my-website
		include "wp-load.php";
		$page = get_page_by_path('church-resources'); //slug of desired page
		echo apply_filters('the_content', $page->post_content);?>

Viewing all articles
Browse latest Browse all 112486

Trending Articles