Site logo

Archived topic

Add Fact Checked By: Author Name' With Meta Info

15 replies · Started by Palash on January 18, 2023

Viewing posts 16–16 of 16

Remove the PHP snippet that Fernando provided, and add this instead:

function display_modified_author(){
    $author = get_the_author();
    $mod_author = get_the_modified_author();
    
    if ( $mod_author !== $author ){
        return 'Fact Checked by: ' . $mod_author;
    }
}

add_shortcode('mod_author','display_modified_author');

Then where you want to display the modified author, add a Headline block, and inside that add the [mod_author] shortcode.
It will only display if the post has a modified_author

This archived topic is closed to new replies.