Last active
December 15, 2015 03:49
-
-
Save krogsgard/5197138 to your computer and use it in GitHub Desktop.
Filter byline w/ Hybrid Core
This file contains hidden or 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
<?php | |
/* filter byline in hybrid core themes that utilize one | |
* | |
* Change "inforock" to your own textdomain for your theme | |
* Use shortcodes as shown for various byline info | |
* More available shortcodes can be found in Hybrid Core docs | |
*/ | |
add_filter( "{$prefix}_byline", 'krogsgard_alter_byline' ); | |
function krogsgard_alter_byline( $byline ) { | |
$current_post_type = get_post_type(); | |
$check_types = array ( 'product', 'page' ); | |
if ( in_array( $current_post_type, $check_types ) ) { | |
$byline = ''; | |
} else { | |
$byline = '<div class="byline">' . __( '[entry-published] [entry-terms taxonomy="category" before=" | "] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'inforock' ) . '</div>'; | |
} | |
return $byline; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment