Wordpress: can this be altered based on user type for CSS?
Posted: Thu Oct 11, 2018 9:06 am
We are trying to show some CSS only when someone is a) logged in and their usertype is 'wholesaler'.
This function should set the CSS for us, but for all.
The idea is to switch off a 'rotating' price area, and just show the price and wholesale price to wholesaler users.
with it turned on, there is a big gap where the code is setting it to be a fixed height. If I disabled the fixed height, when logged in as wholesaler, the Price below the wholesale title disappears.
This function should set the CSS for us, but for all.
The idea is to switch off a 'rotating' price area, and just show the price and wholesale price to wholesaler users.
with it turned on, there is a big gap where the code is setting it to be a fixed height. If I disabled the fixed height, when logged in as wholesaler, the Price below the wholesale title disappears.
Code: Select all
add_action('wp_head', 'add_css_head');
function add_css_head() {
if ( is_user_logged_in() ) {
?>
<style>
.wholesale_price_container
{
line-height: 20px;
}
.grve-product-item .grve-product-content {
overflow: visible;
height: 65px;
}
.grve-product-item .hover .grve-product-switcher,
.grve-product-item .grve-product-switcher.product-added {
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
</style>
<?php
}
}