One of the frequent questions that I get asked is how to create a grid layout for our WordPress Portfolio Plugin. It’s actually pretty simple, as you just need to use floats to shift the websites around. So to make things really easy, here’s a copy’n'paste example for doing a grid layout.
To see what we’re trying to achieve, this is a live example of the grid system working.
Grid Demo
A collection of websites for the grid demo.
The portfolio shortcode and HTML
The HTML/shortcode you need to paste into a page or post to achieve the above layout is simply this:
<div id="portfolio-grid"> [wp-portfolio groups="1"] <div class="footer"> </div></div>
The portfolio shortcode and HTML
The CSS you need to give the grid layout (which can be pasted into the Template CSS section in Layout Settings in the plugin settings, or into your template’s styles.css) is below.
/* Grid Example */
#portfolio-grid .portfolio-website {
width: 150px;
float: left;
height: 245px;
border: 1px solid #BAD4E3;
background: #E3EAF2;
text-align: center;
margin: 3px;
}
#portfolio-grid .website-description {
text-align: left;
}
#portfolio-grid .website-name {
font-size: 10pt;
}
#portfolio-grid .website-url {
display: none;
}
#portfolio-grid .website-thumbnail {
float: none;
text-align: center;
margin: 3px auto 10px;
}
#portfolio-grid .footer {
clear: both;
}The bits that make it work are the width of each portfolio item, the floating left, and the fixed height. All the other styles can be adjusted to suit your website.
Enjoy!
Dan










Thanks for this Dan, this couldn’t have been posted at a better time. I have on my to-do list for the weekend to reinstall WP Portfolio on my main blog and I will certainly be using the grid layout!
Thanks again,
Darren
This was a great help Dan. I’ve been doing all this by hand until now, while converting my website to WordPress I found your plugin. The grid layout makes the Portfolio more in tune with the look I wanted. Thanks so much! Carol
You’re welcome Carol! :)