Created
June 17, 2014 01:13
-
-
Save rfmeier/f3832a5fdd89ca6f946f to your computer and use it in GitHub Desktop.
Create custom Genesis post info based on the post type.
This file contains 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 | |
add_filter( 'genesis_post_info', 'jspt_memoriam_post_info_filter' ); | |
/** | |
* Callback for Genesis 'genesis_post_info' filter. | |
* | |
* @param string $post_info The current post object info. | |
* @return string $post_info The current post object info. | |
*/ | |
function jspt_memoriam_post_info_filter( $post_info ) { | |
// if not post type 'memoriam', return default post info | |
if( 'memoriam' !== get_post_type() ) | |
return $post_info; | |
return '<span class="entry-department">'.get_post_meta( get_the_ID(), 'wpcf-department', true).'</span> | |
Deceased: <time class="entry-time" itemprop="dateDeceased" datetime="'.get_post_meta( get_the_ID(), 'wpcf-deceased-date', true).'">'.date("F j, Y", get_post_meta( get_the_ID(), 'wpcf-deceased-date', true)).'</time> | |
[post_comments] | |
[post_edit]'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment