Skip to content

Instantly share code, notes, and snippets.

@10h30
Forked from srikat/functions.php
Last active August 29, 2015 14:19
Show Gist options
  • Save 10h30/6e4ccd5bae1edd5c8594 to your computer and use it in GitHub Desktop.
Save 10h30/6e4ccd5bae1edd5c8594 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