• Home
  • Project
  • Slider
  • Custom Website Design
  • Services
  • Social Media
  • Blog
  • Contact
    • Request a Quote

Areuconnected.com

Just another WordPress site

  • Home
  • Code Snippets
  • Genesis
You are here: Home / Code Snippets / Removing genesis post_info from a Single or multiple Category

Removing genesis post_info from a Single or multiple Category

November 22, 2011 by onnoysomoy 1 Comment

For a clients website I need to remove post info for multiple categories. So, here is the code I use to remove genesis_post_info from multiple categories.

add_action( 'genesis_before_post', 'auc_conditional_post_actions' );
function auc_conditional_post_actions() {
if( in_category( '1' ) ) {
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
}
else {
add_action( 'genesis_before_post_content', 'genesis_post_info' );
}
}

// Use below code if you want to remove from multiple categories
add_action( 'genesis_before_post', 'auc_conditional_post_actions' );
function auc_conditional_post_actions() {
if(in_category(array('1', '2', '3'))) {
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
}
else {
add_action( 'genesis_before_post_content', 'genesis_post_info' );
}
}
view raw removing genesis_post_info This Gist brought to you by GitHub.

Add above code to the bottom of your child theme’s functions.php file.

Filed Under: Code Snippets, Genesis Tagged With: action hooks, code snippets, genesis, genesis framework, Gist, snippets, tricks, WordPress

Comments

  1. Janai says:
    January 15, 2012 at 3:06 am

    Your answer lifts the intelligence of the dbtaee.

    Reply

Speak Your Mind Cancel reply

*

*

Recommended Hosting

cpanel shared hosting

Company info

  • Home
  • About
  • Portfolio
  • Services
  • Qoute Us
  • Contact Us

Receive great tips via email

Our Partners

  • partners
  • partners
  • partners
  • partners

Top Stories

  • Removing genesis post_info from a Single or multiple Category
  • Insert custom content after single post
  • How to Add an Additional Wrap on Genesis Child Theme
  • Genesis Framework – Footer
  • Customizing Genesis Footer Content

Valid XHTML 1.0 Transitional