Get Page and Post Content – Custom Template
-
Hi,
I use the code below to grab content from page 312 in my custom template. I’m wondering if I can use this template for many pages, but I need to use a function without any specific page ID as pages ID will be 312, 313, 314, etc…Something that grab the content of the page whatever is the page.<?php $page_id = 312; $page_data = get_page( $page_id ); $content = $page_data->post_content; $title = $page_data->post_title; echo $page_data->post_content; ?>
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Get Page and Post Content – Custom Template’ is closed to new replies.