I’m new to wordpress and PHP, and after a while trying to code a magazine style layout using multiple loops, a friend turned me onto styling one loop with multiple post appearances using children.
Example:
.hentry:first-child {
background-color: gray;
height: 460px;
}
This saves me having to categorize and uncategorize posts to get them to appear from most recent onward but with their correct styling.
The parent/child concept worked great, until I tried to style the .entry-content class which is applied to the excerpts on all posts.
I have tried:
.entry-content:first-child {
<--styles-->
}
But no luck. The only thing that appears to make a difference is styling the .entry-content class itself, but this obviously won’t do since the three appearances I have going are quite different in size and so forth.
A few people from the WordPress Answers website seemed to think I would have better luck at Stack Overflow.
Any suggestions? Framework in progress (very in progress) is at: http://piquantblog.com
try
if you want to target the entry-content in first hentry