Skip to content

Instantly share code, notes, and snippets.

@NicktheGeek
Created January 18, 2013 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save NicktheGeek/4566152 to your computer and use it in GitHub Desktop.
Save NicktheGeek/4566152 to your computer and use it in GitHub Desktop.
Sometimes you need to add or remove actions conditionally. here is a simple bit of code that allows this to be done within the functions.php file instead of requiring multiple template files.
<?php
add_action( 'genesis_before', 'child_conditional_actions' );
function child_conditional_actions() {
if( /**insert your conditional statements here */ ) {
//put your actions here
}
//you could add additional conditional statements as needed here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment