Created
August 24, 2017 08:33
-
-
Save signsi/5e4512207265403252e57a10aff8155e to your computer and use it in GitHub Desktop.
[Show content of static blog page] #php #wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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