Answers for "how to get post data by id in wordpress"

PHP
3

wordpress get post id

// Retrieve the ID of the current item in the WordPress Loop.
get_the_ID()
Posted by: Guest on February-19-2021
0

wp get post content by id

$post_id = 5// example post id
$post_content = get_post($post_id);
$content = $post_content->post_content;
echo apply_filters('the_content',$content);
Posted by: Guest on July-19-2020

Code answers related to "how to get post data by id in wordpress"

Browse Popular Code Answers by Language