Skip to content

Instantly share code, notes, and snippets.

@mjsdiaz
Created September 27, 2014 23:43
Show Gist options
  • Save mjsdiaz/609551682e015176fcc2 to your computer and use it in GitHub Desktop.
Save mjsdiaz/609551682e015176fcc2 to your computer and use it in GitHub Desktop.
Add Post Meta (Categories and Tags) to Pages in Genesis Child Theme
<?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