Skip to content

Instantly share code, notes, and snippets.

@srikat
Created January 13, 2014 17:38
Show Gist options
  • Save srikat/8404481 to your computer and use it in GitHub Desktop.
Save srikat/8404481 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. http://sridharkatakam.com/different-post-meta-different-views-genesis/
//* 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