Community Forums › Forums › Archived Forums › Design Tips and Tricks › nth-of-type CSS on Agency Pro Featured Posts
Tagged: 3n+1, agency pro, featured posts widget, genesis
- This topic has 8 replies, 3 voices, and was last updated 11 years, 4 months ago by
staplechasers.
-
AuthorPosts
-
March 22, 2014 at 9:41 am #96072
chamster
MemberI'm trying to achieve a row of 4 articles using the Genesis Featured Posts widget in the Home Middle widget area of Agency Pro theme. Here's the page: http://localhost/garthstein.com/2014/website/.
I've adjusted the sizes of the divs and images, but I can't find where the css gets generated to cause a new row after the third article.
The article elements have the following css:
.agency-pro-home .featuredpost .entry {
float: left;
}But the fourth article (and the first) have the following css:
.home-middle .featuredpost .post:nth-of-type(3n+1) {
clear: left;
}This causes those to be displayed below the preceding articles, effectively creating a new row. I get that. I see how and why it works. What I can't figure out is where the nth-of-type(3n+1) gets assigned to those articles. If I could find that code , it seems I could change it to 4n+1 and get 4 articles in a row instead of 3.
Anybody have any ideas? Thanks!!
March 22, 2014 at 4:09 pm #96099Brad Dalton
ParticipantLine 1268 which you can find using the search feature in Notepad++
March 22, 2014 at 4:37 pm #96105Brad Dalton
ParticipantActually, you don't need to do that unless you want to change the home-bottom.
For the home-middle widgets, you can simply change the width to 25%
.agency-pro-home .featuredpost .entry { background: none; float: left; width: 25%; }And change the featured image size in your functions to 285px width
add_image_size( 'home-middle', 285, 285, TRUE );
Then change the height for the background in CSS
March 22, 2014 at 11:17 pm #96128chamster
MemberLine 1268 in which file?
I'm on a Mac, so I can't use Notepad++
March 22, 2014 at 11:19 pm #96129chamster
MemberI've already done that css with the 25% etc. Made things look right, as far as sizes of boxes go, but still 3 columns, which is why I'm convinced that the nth-of-type(3n+1) is the key to solving that problem.
March 23, 2014 at 9:01 am #96173chamster
MemberOkay I found the 3n+1 code in style.css of Agency Pro theme. I don't know how I missed it. I searched that file so many times, even doing a "find" on the number 3 and on +, etc. So I'm baffled at how I didn't find it, but hopefully my wasted hours and brddalton's responses above will prevent someone from wasting as much time in the future.
At any rate, I changed 3n+1 to 4n+1 and that's it, done. Simple as that, and as simple as I knew it had to be.
March 23, 2014 at 11:39 am #96197Brad Dalton
ParticipantMarch 23, 2014 at 11:46 am #96202Brad Dalton
ParticipantMy concern was that the 3n will change the home bottom widgets as well.
July 28, 2014 at 7:47 am #116059staplechasers
MemberThanks guys worked like a charm!!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.