Load dynamic content in a wordpress website

If you wanna call content of one page to another page then for that you need to make custom template.

For example if you have 2 pages (page a and page b) then make template for page a. And now you want to add content of page b into page a, this can be done with following code

$include = get_pages('include=10'); //Assigning ID of page
$content = apply_filters('the_content',$include[0]->post_content);
echo $content;

In the above code code I have assign ID 10 to get_pages() function, just for demo purpose. Replace 10 with your actual page ID whose content you want to show in page a.

Just Paste the above code in custom template (made for page a) on location of your choice and page b content will get appear on that location.

Leave a Comment