• Resolved smlcd

    (@smlcd)


    Hi,

    A huge thanks for this plugin that has made my life much easier than expected last week !

    There is only one issue that I haven’t been able to solve : in my current template, I use a taxonomy field to distinguish projects timelines (ongoing, past, recent).
    Ideally, background colors for each of these terms would be different… (Ongoing in yellow, past in grey, for instance.)
    I’ve tried to write an additional CSS, but i’m a begginer on this and my synthax has not brought any result.

    Any ideas ?..
    Thanks a lot in advance,
    Clément

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hey Clément

    Right now our CSS is a bit heavy handed (should be easier to override) and we’ll be changing that in future.

    However, an easy way to get around this would be to first unset the background color for your taxonomy terms in your template.

    Then you can use CSS like:

    .cl-element-taxonomy__term.recents {
        background-color: #f00;
    }

    If you check the source code (I think you probably already did), all your taxonomy terms get their own class added.

    So you can also have:

    .cl-element-taxonomy__term.en-cours {
        background-color: #0f0;
    }

    Let me know if setting the background to transparent works for you, if not, I’ll be able to find some other CSS that does the job.

    Thanks

    • This reply was modified 2 years, 6 months ago by Code Amp.
    • This reply was modified 2 years, 6 months ago by Code Amp.
    • This reply was modified 2 years, 6 months ago by Code Amp.
    Thread Starter smlcd

    (@smlcd)

    Hi Ross,

    Thanks for answering so promptly !

    A skilled friend helped me out this morning and figured a perfectly working solution, although maybe a little more complex than needed..

    Here’s what we have implemented :
    – In the class-taxonomy.php, we have added the code below in line 71. (at the time, we didn’t know if taxonomies terms got their own classes, so that introduced a new one. From your message, I understand that this step was unnecessary)

    <blockquote>	}
    			$term_attributes = array(
    			'class' => 'cl-element-taxonomy__term '.$post_term['slug'],
    		);

    -Then in the quick custom CSS of my theme (Enfold), we added the following lines :

    `.cl-element-taxonomy__term.passes{
    background-color:#A6B7BA !important
    }
    .cl-element-taxonomy__term.recents {
    background-color:#00CFFF !important
    }
    .cl-element-taxonomy__term.en-cours {
    background-color:#FFE000 !important
    }`

    It seems that the “!important” argument has won the battle, and I didn’t have to set a transparent background in the template !

    Thanks again ! Issue solved ??
    Clément

    Plugin Author Code Amp

    (@codeamp)

    Great work!

    In fact, I realised, we don’t add the taxonomy class.

    I looked at the source code of your site, and assumed we did ???♂?

    So really, you fixed it yourself.

    It would be good to add this functionality to our plugin too though, so I’m putting on the feature requests ??

    All the best

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘TEMPLATES – Custom terms background colors for specific taxonomy values’ is closed to new replies.