Grow your CSS skills. Land your dream job.

Marking up blog post listing ( title and excerpts, not full content) with OL [WordPress]

  • # June 18, 2013 at 6:13 pm

    Quick question, mostly about the semantics and also just general opinion, as well as any negatives, if it is a passable idea to use Ordered Lists (OL) to mark up the main post listings on a WordPress site. These listings are just the title, maybe some meta data as to when it was posted, and the short excerpt.

    I like the idea of using an ordered list, as the posts ARE in order (reverse chronologically), but with it having a title, date posted, by which author and the excerpt, that it may be a little heavy for just an OL list. Personally, i prefer using the list semantics over standard divs, but that may just be me. I do wonder though what effect it would have on SEO, if any.

    # June 18, 2013 at 6:38 pm

    < ?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

  • < ?php the_title(); ?>

    < ?php the_excerpt(); ?>

  • < ?php endwhile; else: ?>

    < ?php _e('Sorry, no posts matched your criteria.'); ?>

    < ?php endif; ?>

# June 18, 2013 at 9:17 pm

Not really what I was asking for. But I would like to point out, in your example, the starting OL tag should be after the IF statement, but before the WHILE statement, otherwise you will have an OL-LI pair for each news post.

Was more or less looking for opinions on if using OL in this instance would be viable. I know it is valid markup, but I am unsure of any other side-effects.

# June 18, 2013 at 9:43 pm

@macharborguy, good catch I was writing it fast for you… edited the `

    ` out…

    I would never use list items for posts. It’s not a list, it’s a list of posts, that may or may not be related… so `article` tag would be better

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".