Twenty Seventeen styling Portfolio and Blog pages
-
I’m trying to make the default /portfolio page (https://maryjowatts.com/portfolio) look like this page with the portfolio shortcode that I’ve styled. (https://maryjowatts.com/portfolio-2/)
Essentially I want a box around each post but only on the Portfolio page (and perhaps the Blog page as well). I want to do this b/c the default styling is shapeless and confusing to read.
The only element I can find to use is “article” but that’s global. I want it to look like this:
{ border: thin solid #482b84; padding: 25px margin-bottom: 30px -webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black; }How do I restrict this style to just Portfolio and Blog and not the other pages?
Thanks!
The blog I need help with is maryjowatts.com.
The blog I need help with is: (visible only to logged in users)
-
Hi there, for the portfolio page, give this a try.
.jetpack-portfolio { border:thin solid #482b84; margin-bottom:3em; -webkit-box-shadow:0 8px 6px -6px #000; -moz-box-shadow:0 8px 6px -6px #000; box-shadow:0 8px 6px -6px #000; padding: 25px; }If you wish to do both the blog and the portfolio archive page, then do this instead.
.jetpack-portfolio, .blog .hentry { border:thin solid #482b84; margin-bottom:3em; -webkit-box-shadow:0 8px 6px -6px #000; -moz-box-shadow:0 8px 6px -6px #000; box-shadow:0 8px 6px -6px #000; padding: 25px; } -
-
-
One last question– If you click on the blog page, the blog entries have the box-shadows but if you click on an entry, there’s no box-shadow. This is what I want. But if you click on Portfolio and click on an entry, that entry has a box-shadow. How do I keep the box-shadow on /portfolio and not on the individual posts?
-
Ah, we can do that. Replace what I had given before with the following.
body:not(.single-jetpack-portfolio) .jetpack-portfolio,.blog .hentry { border:thin solid #482b84; margin-bottom:3em; -webkit-box-shadow:0 8px 6px -6px #000; -moz-box-shadow:0 8px 6px -6px #000; box-shadow:0 8px 6px -6px #000; padding:25px } -
This code is exactly what I wanted to do and I so appreciate your help. There’s no way I would have figured that out on my own, but I would have wasted hours trying! THANKS!
-
- The topic ‘Twenty Seventeen styling Portfolio and Blog pages’ is closed to new replies.