Created
September 27, 2014 23:43
-
-
Save mjsdiaz/609551682e015176fcc2 to your computer and use it in GitHub Desktop.
Add Post Meta (Categories and Tags) to Pages in Genesis Child Theme
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 | |
//* Remove line above | |
//* Customize the entry meta in the entry footer | |
//* First install plugin Post Tags and Categories for Pages | |
add_action('genesis_entry_footer', 'custom_page_post_meta'); | |
function custom_page_post_meta() { | |
if ( 'page' === get_post_type() ) { | |
$cats = get_the_category_list( $sep = ', ', $post_id ); | |
$tags = get_the_tag_list( $sep = ', ', $post_id ); | |
if ( $cats || $tags ) { | |
echo '<footer class="entry-footer"><p class="entry-meta">'; | |
if ($cats) { | |
echo '<span class="entry-categories">Filed Under: ' . $cats . '</span>'; | |
} | |
if ($tags) { | |
echo '<span class="entry-tags">Tagged With: ' . $tags . '</span>'; | |
} | |
echo '</p></footer>'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment