Created
January 13, 2014 17:38
-
-
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/
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
//* 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