add content from page to post including title
-
Hi, I am using the following code in many places successfully.
<?php $id = 1000; $p = get_page($id); if ( get_post_status ( $id ) == 'publish' ) { echo apply_filters('the_content', $p->post_content); } ?>
For those wanting to use it, that php code grabs the contents of page with id 1000 and inserts it in the same location as that code. Very useful.
But I have one instance where I would like that pages title as well as its content. As best I can figure I could add a second filter to include the_title to the_content but I don’t know how to do that or if it’s even a good approach.
Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add content from page to post including title’ is closed to new replies.