The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Most semantic HTML for a “latest tweets” list?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #45079

    I’m getting *pretty* nitpicky here, but I’m wondering which of these is the best solution.

    Tweet content

    Author name

    html5doctor says that the latter is the “officially recommended” method for citing a blockquote, but article seems more fitting for this.

    A figure is typically supposed to be something that is referenced from the main text, and since tweets are entirely separate, I’m leaning toward article for this.



    It’s for a WordPress theme I’m developing, so I haven’t gotten that far yet.

    I know I have a solution on my own site that works just fine (although it fails to fetch any tweets if I haven’t tweeted in awhile)


    function recentTweets($username, $number){


    $tweet = fetch_feed(“” . $username . “&rpp=” . $number );

    if (!is_wp_error( $tweet ) ) :

    $maxitems = $tweet->get_item_quantity($number);

    $rss_items = $tweet->get_items(0, $maxitems);


    if ($maxitems == 0) echo “

    Failed to load any tweets. Bummer.

    My profile


    else foreach ( $rss_items as $item ) {

    $content = html_entity_decode($item->get_content());

    $link = html_entity_decode($item->get_permalink());

    $date = $item->get_date(‘U’); // retrives the tweets date and time in Unix Epoch terms

    $blogtime = current_time(‘U’); // retrives the current browser client date and time in Unix Epoch terms

    $dago = human_time_diff($date, $blogtime) . ‘ ago’; // calculates and outputs the time past in human readable format

    Here’s the code I’m using on my site. I don’t remember where it came from.

    echo “< figure class="recent-tweet">< blockquote>$content < figcaption>$dago“;




    …Aaand that’s why I prefer bbcode to markdown

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.