Last active
August 29, 2015 14:06
-
-
Save dryan1144/d0c8b650a91ba895cb34 to your computer and use it in GitHub Desktop.
Add blog page content before posts
This file contains 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 | |
/* | |
---------------------------------------------------------------------------------- | |
Ouput content for blog page (Settings > Static page > posts page) page above posts | |
---------------------------------------------------------------------------------- | |
*/ | |
function wphandcrafted_add_blog_page_content() { | |
if ( is_home() ) { | |
$post = get_page( get_option('page_for_posts')); | |
echo wpautop($post->post_content); | |
} | |
} | |
add_action ('loop_start', 'wphandcrafted_add_blog_page_content'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment