Skip to content

Instantly share code, notes, and snippets.

/functions.php Secret

Created June 27, 2017 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4c201cf9ea2cd96da3c4c4e2de067df4 to your computer and use it in GitHub Desktop.
Save anonymous/4c201cf9ea2cd96da3c4c4e2de067df4 to your computer and use it in GitHub Desktop.
Test
<?php
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