Support » Fixing WordPress » What's the PHP code for putting your post thumbnails in 3 columns?

  • Can someone help me with codes on putting your 6 latest posts’ thumbnails on a page (including the title and the css)

    The sample look can be found here:
    Although, those are created using plain html.


Viewing 9 replies - 1 through 9 (of 9 total)
  • It’s actually not PHP, it’s HTML and CSS (when done right)…Create a custom Page Template for this task if such layout is not provided by a theme or plugin…



    Forum Moderator


    what theme are you using?

    what do you have so far?

    the example uses a html table to structure the images – do you need to do the same?

    I would NOT recommend using tables, they haven’t been relavent for some time now, and don’t follow current web standards.

    As Seacoast said, it’s HTML and CSS for the structure, PHP to call the posts and thumbnails. After reviewing the codex links alcymtyth showed you try using standard <div> tags with the float: left element and the width defined inside of a larger container. More info here about how to set that up:

    Almost all sites continue to use a basic table structure for site layout as no matter how often voted on, CSS3 nor HTML5, are the rule (yet)…

    That’s the HTML5 spec put forward by the W3C. Working drafts began in 2008 and continue through today. This is the spec that browser developers follow to determine what features to add. This includes Opera, Mozilla, Webkit (Safari and Chrome) and in their newest version, even IE.

    New Theme: Twenty Twelve

    This is Lance Willet explaining why the new Twenty Twelve theme is responsive, which is a CSS3 technique to make sure that a webpage adapts to the size of the screen it is being read on, on tablets, mobile devices and larger desktops. This is something that is not even remotely possible using a table layout.

    In 2012, to say that a table structure is still appropriate or recommended, and that HTML5 is undecided on, is just wrong and responsible WordPress users need to make sure to make their sites semantic, future friendly and standards compliant.

    (end diatribe)

    This is something that is not even remotely possible using a table layout

    For serving content to those who want a full screen experience, Site layout is critical…for serving content to other ‘media’ we invoke and add rules in that css section….@jhoffm34, can you post your example please of a fully compliant HTML5 and CSS3 site?

    Sure, a good example of a three column responsive layout is at:
    with an explanation of how it is done including some tips on pseudo selectors. These days, it seems like being standards compliant is important in making sure your user always has the best experience. A table layout can certainly be adaptive to an extent, but it cannot be responsive and is not nearly as flexible.

    There are plenty more examples at which I recommend checking out for anyone who’s interested.

    I actually just use the WordPress upload to have images show up in a column. Check [unrelated link moderated – start your own topic in ‘Your WordPress’ if you want to present your site] you can see everything I did just using WordPress and images.

    @ jhoffm34:

    Since this is a forum – can you share some WP sites that validate fully to HTML5 and CSS3 please???

    Getting simple sites to do so is not so difficult…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘What's the PHP code for putting your post thumbnails in 3 columns?’ is closed to new replies.