Skip to content

Instantly share code, notes, and snippets.

@media317
Created March 11, 2014 20:34
Show Gist options
  • Save media317/9494417 to your computer and use it in GitHub Desktop.
Save media317/9494417 to your computer and use it in GitHub Desktop.
Conditional tag with Custom Post Type and Custom Taxonomy
//* Custom Genesis Loop
remove_action ( 'genesis_loop', 'genesis_do_loop' );
add_action ( 'genesis_loop', 'cbc_custom_loop' );
function cbc_custom_loop() {
if (has_term('custodial')) {
echo '<h1>';
echo the_title();
echo '</h1>';
echo '<h2>' . genesis_get_custom_field ('cbc_priority_level') . '</h2>';
echo '<p>' . genesis_get_custom_field ( 'cbc_f_name' ) . '</p>';
} else {
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment