Community Forums › Forums › Archived Forums › Design Tips and Tricks › Conditionally Set Header Height on Portfolio Pages
Tagged: custom header background
- This topic has 4 replies, 4 voices, and was last updated 10 years ago by
jacobgoh101.
-
AuthorPosts
-
November 13, 2015 at 9:37 am #171002
bisonbrah
ParticipantCurrently my custom header image is getting reduced from 1920x350 > 1920x130 due position: absolute in .site-header.
How would I conditionally tell the .site-header to set min-width to 350px to accommodate the full height of the custom header
thus the .backstretch should inherit the new height of 350px (I think...)?Any help would be fantastic!
http://sscreativestudio.com/portfolio/balpark-media/
November 13, 2015 at 10:56 am #171013Porter
ParticipantWhat do you mean by "conditionally", on certain pages? If you want it changed in general, that wouldn't really be conditionally, that would just be changed.
Additionally, please link to your site or state the theme so we can take a look.
November 13, 2015 at 11:04 am #171014bisonbrah
ParticipantReference this url http://ssstudios.wpengine.com/portfolio/balpark-media/
I mean conditionally as in if post (in this case a portfolio project) has
-
extender_has_label('portfolio')
then set .site-header to a height of 350px. I believe if .site-header is set to 350px then the .backstretch will inherit the same size....
Any clearer?
November 13, 2015 at 11:49 am #171019KevinPowell
Memberposition: absolute; is simply the last thing in a big line of code, it isn't effecting the size of area.
Part of the reason the height of the header is changing, is that your navigation goes from being on the right of your logo to underneath your logo when the screen gets smaller.
While I was playing around on your site, it seemed to change over to a coming-soon page.... that said, it's using Backstretch, which is a JavaScript plugin which dynamically resizes background images.
For me, the behaviour is a good thing because it keeps the navigation menu vertically centered in that space.
November 13, 2015 at 7:27 pm #171055jacobgoh101
MemberNot sure if I understand your problem properly,
but the way i used to modify CSS on only a certain post type is through using wordpress conditional tagsomething similar to this works for me (put in functions.php)
add_action( 'woocommerce_before_main_content', 'remove_product_image_from_composite', 1 );
function remove_product_image_from_composite(){
if ( is_single( array( 221,228 ) ) ) {
echo "<style>
.woocommerce div.product div.summary, .woocommerce-page div.product div.summary{
width:100%;
}
.product_meta{
display: none;
}
.related.products{
display:none;
}
</style>";
}
} -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.