- This topic has 9 replies, 2 voices, and was last updated 4 years, 3 months ago by Tom.
-
AuthorPosts
-
January 17, 2020 at 8:01 am #1135270webcréateur
Hi there,
For certain contributions we have to show a closed padlock to the left of the titles, e.g.: https://fontawesome.com/v4.7.0/icon/lock
This closed lock should only be displayed only for a specific taxonomy term.
As soon as the user is logged in, the lock should be displayed open.
https://fontawesome.com/v4.7.0/icon/unlockHow can we best implement this with GP Pro and WPSP Pro?
https://prnt.sc/qp4toiI have tested the following, unfortunately without success:
https://wordpress.stackexchange.com/questions/181630/change-css-when-user-is-logged-inJanuary 17, 2020 at 6:02 pm #1135648TomLead DeveloperLead DeveloperHi there,
Can you link me to the page where these posts are viewable? It depends on whether the posts themselves have a class assigned to them with the taxonomy you’re trying to target. Which taxonomy is the target?
I should be able to write up some CSS to do this 🙂
January 18, 2020 at 10:34 am #1136268webcréateurHi Tom,
That would be so great. 🙂
I added the Link (only admin can see).
.htaccess protection credentials:
User: uz
Password: Tester2020skJOP!Thank you.
January 18, 2020 at 6:12 pm #1136479TomLead DeveloperLead DeveloperWhere on that page can I see this?: https://prnt.sc/qp4toi
I’m not seeing it at the moment.
Let me know 🙂
January 18, 2020 at 11:08 pm #1136569webcrĂ©ateurIf you open the link I posted (only admin can see) …
https://prnt.sc/qp4toi
This is the entry post title of that post.Not visible for you?
January 19, 2020 at 9:24 am #1137051TomLead DeveloperLead DeveloperCan you disable any caching/minifying plugins, for now? Your site doesn’t seem to have any CSS applying to it right now, so it’s just a big white page.
January 19, 2020 at 9:51 am #1137068webcrĂ©ateurThat’ s odd. I just disabled every caching plugin …
Could you also please try another browser?
January 19, 2020 at 4:23 pm #1137316TomLead DeveloperLead DeveloperI’m seeing it now 🙂
So, you’re currently adding “Plus” using a pseudo selector.
Do you have the lock icon as an icon font or an SVG? It might be difficult to achieve, as you’re already using the pseudo on the Plus.. If we include the icon font with the “Plus”, they will be the same color..
We could apply the “Plus” to the
<a>
pseudo selector instead, and then using the<h2>
pseudo for the lock?January 20, 2020 at 7:34 am #1138026webcréateurSo, you’re currently adding “Plus” using a pseudo selector.
Yes, David helped to archive that:
https://generatepress.com/forums/topic/post-badges-wp-show-posts/We could apply the “Plus” to the
<a>
pseudo selector instead, and then using the<h2>
pseudo for the lock?This sounds like a good solution for us.
Many thanks in advance. 🙂
January 20, 2020 at 10:30 am #1138247TomLead DeveloperLead DeveloperSomething like this should work:
body:not(.single) article[class*="post-badges"] h2 a:before, body[class*="badge-"] h1 a:before { float: left; color: #fff; padding: 0 7px; text-transform: uppercase; font-weight: 700; margin: 3px 10px 0 0; font-size: .6em; letter-spacing: .7pt; line-height: 1.7; content: 'Plus'!important; background-color: red; } body:not(.single) article[class*="post-badges"] h2:before, body[class*="badge-"] h1:before { content: "lock"; color: #000; } body:not(.single).logged-in article[class*="post-badges"] h2:before, body[class*="badge-"].logged-in h1:before { content: "unlock"; }
You’ll just need to replace the “lock” and “unlock” with the font icons.
-
AuthorPosts
- You must be logged in to reply to this topic.