Skip to content

Instantly share code, notes, and snippets.

@signsi
Created August 24, 2017 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save signsi/5e4512207265403252e57a10aff8155e to your computer and use it in GitHub Desktop.
Save signsi/5e4512207265403252e57a10aff8155e to your computer and use it in GitHub Desktop.
[Show content of static blog page] #php #wordpress
<?php
global $post;
$page_for_posts_id = get_option( 'page_for_posts' );
if ( $page_for_posts_id ) :
$post = get_page( $page_for_posts_id );
setup_postdata( $post );
?>
<div id="post-<?php the_ID(); ?>">
<header>
<h1><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
</div>
</div>
<?php
rewind_posts();
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment