If you add a portfolio page to your StudioPress theme and can’t work out why it doesn’t display correctly, here’s one fix which may solve the problem.
Firstly, here’s a common problem which happens when changing the number of featured image columns you want displayed inline.
All you need to do to fix the problem which causes a gap, is modify this line of CSS code:
.cpt-portfolio .portfolio:nth-of-type(6n+1) {
clear: left;
}
Simply change the 6 to the same number of columns you want to display which is 4 in this case:
.cpt-portfolio .portfolio:nth-of-type(4n+1) {
clear: left;
}
And here’s what your portfolio archive now looks like:
Learn more about the nth-of-type pseudo-class.
Was This Tutorial Helpful?