To add page content to Posts Page so it will appear on the front page above your posts in WordPress.

open …wp-content/themes/albizia/home.php (index.php on some themes)
add the following code below <div id=”contentwrap”>

<?php
if ( 'page' == get_option('show_on_front') && get_option('page_for_posts') && is_home() ) : the_post();
$page_for_posts_id = get_option('page_for_posts');
setup_postdata(get_page($page_for_posts_id));
?>
<div id="post-<?php the_ID(); ?>">
<div>
<?php the_content(); ?>
<?php edit_post_link('Edit', '', '', $page_for_posts_id); ?>
</div>
</div>
<?php
rewind_posts();
endif;
?>

Save file to original location.
From www.webdesignfromscratch.com

1 Comment

  • Adrian says:

    That’s awesome, thanks

    I used the above to add content to the bottom of my Posts Page, essentially adding what looks similar to an Archives widget underneath the latest posts (client wanted to archives to appear in the page, as opposed to the sidebar) and with a bit of styling, will look v.nice

Leave a Reply

Your email address will not be published. Required fields are marked *

Design by FtroopDad Theme by itx