In this tutorial, i’ll provide all the instructions which make it as easy as possible to add a portfolio page to the Modern Portfolio Pro theme by StudioPress.
Use all the code in this tutorial (excluding the CSS) and then add this CSS code at the end of your child themes style.css file.
.executive-pro-portfolio .content {
padding: 10px 10px 0;
padding: 1rem 1rem 0;
}
.executive-pro-portfolio .entry-title {
font-size: 16px;
font-size: 1.6rem;
text-transform: uppercase;
margin-bottom: 30px;
margin-bottom: 3rem;
text-align: center;
}
.executive-pro-portfolio .archive-title {
text-align: center;
margin-bottom: 30px;
margin-bottom: 3rem;
}
.executive-pro-portfolio .portfolio {
float: left;
padding: 0 10px 10px;
padding: 0 1rem 1rem;
width: 25%;
}
.executive-pro-portfolio .portfolio:nth-of-type(4n+1) {
clear: left;
}
.single-portfolio .content {
text-align: center;
}
.executive-pro-portfolio .entry,
.single-portfolio .entry {
margin-bottom: 0px;
margin-bottom: 0rem;
}
.executive-pro-portfolio .portfolio-featured-image img:hover {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=5)";
filter: alpha(opacity=5);
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
border: 2px solid black;
}
.executive-pro-portfolio .entry-header .entry-meta {
border-top: 0;
}
@media only screen and (max-width: 767px) {
.executive-pro-portfolio .portfolio {
margin: 0;
width: 100%;
}
.executive-pro-portfolio .portfolio {
text-align: center;
}
.executive-pro-portfolio .portfolio {
padding: 0 0 30px;
padding: 0 0 3rem;
}
}
You will need to go to Settings > Permalinks and re-save your permalinks to flush the cache for your re-write rules after adding the code in your theme.
Prefer More or Less Columns?
Simply change the values in these 2 code blocks for the width from 25% to 33.3% and number for nth-of-type from 4n to 3n.
.executive-pro-portfolio .portfolio {
float: left;
padding: 0 10px 10px;
padding: 0 1rem 1rem;
width: 33.33333333333%;
}
.executive-pro-portfolio .portfolio:nth-of-type(3n+1) {
clear: left;
}
You could also increase the size of the featured image as this theme uses a wide portfolio archive template.
add_image_size( 'portfolio', 350, 200, TRUE );
Leave a Reply
You must be logged in to post a comment.