dansullivannyc
Member
Posted 3 years ago #
I want to have a content area above my posts where I can use the wordpress dashboard to edit the content. However, when I go to manage>pages and then to the page which has my blog posts, and try to add text, nothing shows up. I have basic dev skills and I'm wondering if I have to go in and add a line of PHP before the post loop to allow content above it. Any feedback would be greatly appreciated! Thanks!
Hi
When you set a page up as a page to display blog posts, any page content on that page is ignored. You can add it into your template using a secondary WP loop. I suggest using get_post as it is easy.
<?php
$page_id = 2; // substitute page_id of page you want content included from for "2"
$page = get_post($page_id);
echo "<p>$page->post_content</p>";
?>
dansullivannyc
Member
Posted 3 years ago #
That worked perfectly! Thank you so much :)