0

I have a Posts page set in settings->reading - posts page is set to a page called "notes"

How can I access the title, content & featured image of the page? WP seems to want to access the first post instead of the page.

1 Answer 1

1

So you can fetch the id using a get_option call, then access the data from there.

$page_for_posts = get_option( 'page_for_posts' );  
$page_data = get_page( $page_for_posts )  ;

Then you can access the properties like this:

<?= get_the_post_thumbnail($page_data->ID) ?>
<h1><?= $page_data->post_title ?></h1>
<?= $page_data->post_content ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.