Monday, July 15, 2013

How to Get Content by ID in WordPress

This function will help you to get content of a particular page of your WordPress website by the ID of the page.

function get_the_content_by_id($post_id) {
$page_data = get_page($post_id);
if ($page_data) {
return $page_data->post_content;
}
else return false;
}


Disqus Comments