Skip to content

Instantly share code, notes, and snippets.

@srikat
Created January 10, 2014 05:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/8347446 to your computer and use it in GitHub Desktop.
Save srikat/8347446 to your computer and use it in GitHub Desktop.
Add Post categories above Post titles and display only Post tags in entry footer in Genesis. Scope: Single Posts, Search results page, static Pages to which 'Blog' Page Template is applied. Context: http://sridharkatakam.com/moving-post-categories-entry-meta-post-title-genesis/#comment-2309
add_action( 'template_redirect', 'sk_categories_above_titles' );
function sk_categories_above_titles() {
if ( ! ( is_singular('post') || is_archive() || is_search() || is_page_template('page_blog.php' ) ) )
return;
add_action ( 'genesis_entry_header', 'sk_show_category_names', 9 );
add_filter( 'genesis_post_meta', 'sk_post_meta_filter' );
}
function sk_show_category_names() {
echo do_shortcode('[post_categories before="Filed Under: "]');
}
function sk_post_meta_filter($post_meta) {
$post_meta = '[post_tags]';
return $post_meta;
}
@srikat
Copy link
Author

srikat commented Feb 5, 2014

If you wish to expand the scope to include Posts listing on homepage as well, change

if ( ! ( is_singular('post') || is_archive() || is_search() || is_page_template('page_blog.php' ) ) )

to

if ( ! ( is_singular('post') || is_archive() || is_search() || is_page_template('page_blog.php' ) || is_home() ) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment