-
AuthorPosts
-
November 20, 2017 at 8:48 pm #879341
Good day, support.
I need the different name colors of categories.
For example, in sidebar and archives it works:right sidebar
.cat-item-39 a:link, .cat-item-39 a:visited {
color: #d20c19 !important;
}archives page
.category-law > div.entry-content-wrapper.clearfix.standard-content > header > span.blog-categories.minor-meta > a {
color: #d20c19 !important;
}Please, could you help me to do this in home page?
November 21, 2017 at 12:06 pm #879668Hey AliAbabwa,
I’m not sure if I understand the problem, what about your CSS is not working? Try to explain a bit further or post a screenshot highlighting the problem.
Best regards,
RikardNovember 21, 2017 at 5:09 pm #879829November 22, 2017 at 2:50 pm #880295Hi AliAbabwa,
I am seeing the category red. Did you get it working for you?
Best regards,
VictoriaNovember 22, 2017 at 3:23 pm #880320Dear Victoria.
I mean not archives page, I mean home page with Enfold widjet!Please, could you help me to do this in home page?
https://netpics.org/image/FbBv7- This reply was modified 6 years, 12 months ago by AliAbabwa.
November 24, 2017 at 12:53 pm #881154Hi AliAbabwa,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
.html_elegant-blog #top .main_color .blog-categories a:link, .html_elegant-blog #top .main_color .blog-categories a:visited { color: #d20c19 !important; }
If you need further assistance please let us know.
Best regards,
VictoriaNovember 24, 2017 at 1:24 pm #881173Dear Victoria.
You don’t understand me)I mean different color of each categorie:
“НОВОСТИ” – #22a7e0
“ЗАКОН И КРИПТА” – #d20c19in home page, in enfold widjet of course.
November 24, 2017 at 5:28 pm #881325Hi AliAbabwa,
You need to check for each article class and assign colors like this
.post-entry-782 .blog-categories a { color: #d20c19 !important; }
If you need further assistance please let us know.
Best regards,
Victoria- This reply was modified 6 years, 11 months ago by Victoria.
November 27, 2017 at 11:45 am #882172Hi Victoria.
It is news site.
I have about 10 different categories that must have different colors, and in each category there will be hundreds, thousands of articles.
So, I need manually to set the each of it…?!
.post-entry-782 .blog-categories a {
color: #d20c19 !important;
}
.post-entry-783 .blog-categories a {
color: #000000 !important;
}
and so on… for thousands of articles…Are you joking?)
Please, look at my first post: November 20, 2017 at 8:48 pm.
I need it automatically like in right sidebar or archives page.
I need it in home page in Blog Posts element.- This reply was modified 6 years, 11 months ago by AliAbabwa.
November 28, 2017 at 9:31 pm #882878Hi,
.blog-categories a { color: #d20c19 !important; } .blog-categories a { color: #000000 !important; }
That code will work for all articles
Best regards,
BasilisNovember 29, 2017 at 12:04 pm #883004Dear Basilis, are you attentively read the topic?
I was already tortured to explain the same thing for 3 moderators((
I need the different color of each categorie for hundreds, thousands of posts in Enfold Blog Posts element (automatically, like in right sidebar or archives page).
Look at new attachment please:
https://netpics.org/image/GLuKPI create new page with Enfold Blog Posts element, look private content, please.
December 1, 2017 at 8:15 am #883764Hi,
We are very sorry for the confusion. The categories have different colors when I checked the home page. Did you figure this out?
Best regards,
IsmaelDecember 1, 2017 at 11:51 am #883840Dear, Ismael.
I have to repeat myself again, look at my last post:
“I create new page with Enfold Blog Posts element, look private content, please.” (for you to understand me)
I mean that my question is about ONE Enfold Blog Posts Element with ALL categories, because I use it in mobile version.
By the way, if we are talking about home page of site, look it in mobile version, please. It is ONE Enfold Blog Posts Element with ALL categories.
And I need the different color of each categorie (in ONE Enfold Blog Posts Element with ALL categories) for hundreds, thousands of posts in Enfold Blog Posts element (automatically, like in right sidebar or archives page).
Look at attachment please:
https://netpics.org/image/GLuKP- This reply was modified 6 years, 11 months ago by AliAbabwa.
December 4, 2017 at 4:26 am #884501Hi!
Thank you for the info. Please add this script in the functions.php file.
// custom script add_action( 'wp_footer', 'ava_custom_script' ); function ava_custom_script() { ?> <script type="text/javascript"> (function($) { function a() { $('.blog-categories').each(function() { var link = $(this).find('a'); var text = link.text(); switch(text) { case 'Закон и крипта': link.css('color', 'red'); break; case 'Мнения': link.css('color', 'green'); break; case 'Новости': link.css('color', 'blue'); break; case 'События': link.css('color', 'orange'); break; default: return null } }); } a(); })(jQuery); </script> <?php }
Regards,
IsmaelDecember 4, 2017 at 1:22 pm #884620At last, it works.
Thank you so much, Ismael!))- This reply was modified 6 years, 11 months ago by AliAbabwa.
December 5, 2017 at 2:27 pm #885067Hi,
Great! Glad we could help. Please feel free to open a new thread if you need anything else. :)
Best regards,
IsmaelAugust 4, 2018 at 12:30 am #993381Hi Ismael I tried the functions.php solution but it fails if one post has two or more categories associated. Each of them would be differently colored, instead. Is there a solution? Thx.
August 4, 2018 at 12:43 am #993383This reply has been marked as private.August 6, 2018 at 7:34 am #993816Hi,
Thank you for using Enfold. The previous script has to be adjusted, so it applies the correct color even when there are multiple categories.
// custom script add_action( 'wp_footer', 'ava_custom_script' ); function ava_custom_script() { ?> <script type="text/javascript"> (function($) { function a() { $('.blog-categories a').each(function() { var text = $(this).text(); switch(text) { case 'Fitness': link.css('color', 'red'); break; case 'Karate': link.css('color', 'green'); break; case 'Danza': link.css('color', 'blue'); break; default: return null } }); } a(); })(jQuery); </script> <?php }
`
Best regards,
IsmaelAugust 6, 2018 at 11:05 am #993876Hi Ismael I pasted the code into the functions.php but nothing changes…
I flushed the cache again and again but nothing…
Few days ago the previous script partially worked but now nothing seems to go…
Note that I’m using it for the page you find in private content.
Thank you.August 7, 2018 at 2:12 am #994166Hi,
Thanks for the update. Open a new thread and then provide the login details in the private field. We’ll check it there.
Best regards,
IsmaelAugust 7, 2018 at 11:57 am #994363August 8, 2018 at 2:28 am #994659 -
AuthorPosts
- The topic ‘Different styles of categories’ is closed to new replies.