Create a gist now

Instantly share code, notes, and snippets.

anonymous /functions.php Secret
Created Jun 29, 2017

What would you like to do?
Wordpress - Post-Datum variabel anpassen
<?php //* mind this opening php tag
/**
* Wordpress - Post-Datum variabel anpassen
*/
add_shortcode( 'post_updated_date', 'rv_set_last_updated_date' );
function rv_set_last_updated_date( $atts ) {
$my_post_meta = get_post_meta($post->ID, 'Update', true);
if ( genesis_get_custom_field('Update') ) {
if ( genesis_get_custom_field('Update') == '1' ){
$last_updated .= 'Aktualisiert am ' . the_modified_date('j. F Y','','',false);
return $last_updated;
} else {
$last_updated .= 'Aktualisiert am '. genesis_get_custom_field('Update');
return $last_updated;
}
} else{
$published_on = get_the_time('j. F Y',false);
return $published_on;
}
}
//* Do those shortcodes when the post has been updated
add_filter( 'genesis_post_info', 'rv_post_info_filter' );
function rv_post_info_filter( $post_info ) {
$post_info = '[post_updated_date] von [post_author_posts_link] [post_comments before=""]';
return $post_info;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment