Modificata la parte che gestisce l'autore nel feed rss

This commit is contained in:
ulaulaman 2021-10-22 02:19:38 +02:00
parent 5cc08427be
commit f4bc27d617
1 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
# aggiunta autori in apertura e messaggio di chiusura per post nel feed
function eduinaf_postrss($content) {
function eduinaf_postrss( $content ) {
if ( function_exists( 'get_coauthors' ) ) {
$coauthors = coauthors_posts_links(", ", " e ", null, null, false);
} else {
@ -29,7 +29,9 @@ function eduinaf_postrss($content) {
}
if( is_feed() ){
$content = '<p>Questo articolo è stato scritto da '.$coauthors.'</p>'.$content.'<p>Leggi Edu INAF</p>';
$url = get_the_author_meta( 'user_url' );
$name = get_the_author_meta( 'display_name' );
$coauthors = '<a href="'.$url.'">'.$name.'</a>';
}
return $content;
@ -41,9 +43,9 @@ add_filter('the_content', 'eduinaf_postrss');
function wpb_last_updated_date( $content ) {
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
if ( $u_modified_time >= $u_time + 86400 ) {
$updated_date = get_the_modified_time('j F Y');
$custom_content .= '<p class="last-updated">Aggiornato il '. $updated_date .'</p>';
$custom_content = '<p class="last-updated">Aggiornato il '. $updated_date .'</p>';
}
$custom_content .= $content;