Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #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?

    #879668

    Hey 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,
    Rikard

    #879829
    #880295

    Hi AliAbabwa,

    I am seeing the category red. Did you get it working for you?

    Best regards,
    Victoria

    #880320

    Dear 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.
    #881154

    Hi 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,
    Victoria

    #881173

    Dear Victoria.
    You don’t understand me)

    I mean different color of each categorie:
    “НОВОСТИ” – #22a7e0
    “ЗАКОН И КРИПТА” – #d20c19

    in home page, in enfold widjet of course.

    https://netpics.org/image/FbBv7

    #881325

    Hi 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.
    #882172

    Hi 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.
    #882878

    Hi,

    .blog-categories a {
    color: #d20c19 !important;
    }
    .blog-categories a {
    color: #000000 !important;
    }

    That code will work for all articles

    Best regards,
    Basilis

    #883004

    Dear 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/GLuKP

    I create new page with Enfold Blog Posts element, look private content, please.

    #883764

    Hi,

    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,
    Ismael

    #883840

    Dear, 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.
    #884501

    Hi!

    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,
    Ismael

    #884620

    At last, it works.
    Thank you so much, Ismael!))

    • This reply was modified 6 years, 11 months ago by AliAbabwa.
    #885067

    Hi,

    Great! Glad we could help. Please feel free to open a new thread if you need anything else. :)

    Best regards,
    Ismael

    #993381

    Hi 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.

    #993383
    This reply has been marked as private.
    #993816

    Hi,

    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,
    Ismael

    #993876

    Hi 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.

    #994166

    Hi,

    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,
    Ismael

    #994363

    Hi Ismael, just done, here:

    Thx.

    #994659

    Hi,

    Alright. Please continue on the other thread. We’ll close this one now. :)

    Best regards,
    Ismael

Viewing 23 posts - 1 through 23 (of 23 total)
  • The topic ‘Different styles of categories’ is closed to new replies.