Last active
August 29, 2015 14:13
-
-
Save calliaweb/cbced7f608a924b65c22 to your computer and use it in GitHub Desktop.
Add title above posts only if there are 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 | |
//* Do NOT include the opening php tag | |
add_action( 'genesis_before_while', 'custom_add_title_before_loop' ); | |
/* | |
* Echo out the title | |
* The genesis_before_while runs after the if( have_posts() ) | |
* and before while( have_posts() ) : the_post(); | |
*/ | |
function custom_add_title_before_loop() { | |
echo '<h2>My Title</h2>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment