Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Raheel Hassan

    (@raheel-hassan)

    I did it just replace this in place of default code in latest-tweets.php file

    // piece together the whole tweet, allowing override
    $final = apply_filters(‘latest_tweets_render_tweet’, $html, $date, $link, $tweet );
    if( $final === $html ){
    $final = ‘<p class=”tweet-user”>’.$screen_name.'</p>’.
    ‘<p class=”tweet-text”>’.$html.'</p>’.
    ‘<p class=”tweet-details”>‘.$date.’</p>’;
    }

    Thread Starter Raheel Hassan

    (@raheel-hassan)

    ISSUE RESOLVED

    It would probably make more sense to use one of the filters described in:

    As modifying the plugin will result in losing your changes if it’s ever updated. Something like this would display the screen name with link before each tweet:

    add_filter('latest_tweets_render_tweet', function( $html, $date, $link, array $tweet ){
        $screenName = $tweet['user']['screen_name'];
        $twitterUrl = 'https://twitter.com/'.$screenName;
        return '<a href="'.$twitterUrl.'">@'.$screenName.'</a><p class="my-tweet">'.$html.'</p><p class="my-date"><ahref="'.$link.'">'.$date.'</a></p>';
    }, 10, 4 );

    anyone know how to solve the issue of tweets not updating, only displaying from 4weeks ago?

    Thanks
    gaz

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display User Name with every tweet’ is closed to new replies.