How do I include the page content of one or more page in another page?
ex. I have pageA, pageB and pageC and I want to include the contents of these pages in pageX
is there a wordpress function that loads the post of a specified page/post?
like show_post("pageA")??
Hi @dany:
There is not a
show_post()
function per se in WordPress core but it is extremely easy to write:Note that this would be called with the page's path, i.e.:
Of course I probably wouldn't name a function as generically as
show_post()
in case WordPress core adds a same-named function in the future. Your choice though.Also, and no slight meant to @kevtrout because I know he is very good, consider posting your WordPress questions on StackOverflow's sister site WordPress Answers in the future. There's a much higher percentage of WordPress enthusiasts answering questions over there.
Hope this helps.
-Mike
Kit Johnson's wordpress forum solution with creating a shortcode works, but adds the inserted page in the top of the new page, not where the shortcode was added. Close though, and may work for other people.
from the wordpress post, I pieced together this which inserts the page where the shortcode is put:
Then, the shortcode bit works as expected. If you don't want the title, title=false does not work, you need to leave title off entirely.