Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/functions.php
Last active August 29, 2015 14:15
Show Gist options
  • Save About2git/2c07cd63e4dedddfc8a8 to your computer and use it in GitHub Desktop.
Save About2git/2c07cd63e4dedddfc8a8 to your computer and use it in GitHub Desktop.
Customize the post meta function to show Tags on Category pages, Categories on Tag archives and both Tags and Categories on single Posts and views other than static Pages
//* Customize the post meta function to show Tags on Category pages, Categories on Tag archives and both Tags and Categories on single Posts and views other than static Pages
add_filter( 'genesis_post_meta', 'sk_post_meta_filter' );
function sk_post_meta_filter($post_meta) {
if ( is_category() ) {
$post_meta = '[post_tags]';
}
elseif ( is_tag() ) {
$post_meta = '[post_categories]';
}
elseif ( !is_page() ) {
$post_meta = '[post_categories][post_tags]';
}
return $post_meta;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment