Skip Navigation

[Resolved] If user meta field is empty then output custom CSS

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by Clayton Chase 3 years, 4 months ago.

Author
Posts
#2145149

Hey guys,

I'd like to execute CSS using the conditional logic. This is the shortcode I've been using that works when output in the page content but I need to apply CSS at the website level.

Whenever I try to output (using GeneratePress Elements hooks) the css it doesn't work. Do you know why it works on the page but not when output in a hook? I've included my code below.

<!--Conditional CSS-->
[wpv-conditional if="( '[types usermeta='headshot' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='network-description' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='titles-credentials' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='tags' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='website' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='date-of-birth' current_user='true'][/types]' eq '' ) OR ( '[types usermeta='instagram' current_user='true'][/types]' eq '' )"]
<style>
.network-alert.gb-button:after {
content: "1";
position: absolute;
right: 14px;
border-radius: 50px;
font-size: 15px;
font-weight: 500;
height: 20px;
width: 20px;
background: #49C5B1;
color: #fff;
line-height: inherit;
display: flex;
flex-wrap: wrap;
align-content: center;
justify-content: space-evenly;
align-items: stretch;
}
</style>
[/wpv-conditional]

#2145217

My issue is resolved now. Thank you!