How do I include the page content of one or more page in another page?
ex. I have pageA, pageB and pa
Hi @dany:
There is not a show_post()
function per se in WordPress core but it is extremely easy to write:
function show_post($path) {
$post = get_page_by_path($path);
$content = apply_filters('the_content', $post->post_content);
echo $content;
}
Note that this would be called with the page's path, i.e.:
Widget" page. ?>
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