• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Category (or tag) IDs as selectors in post meta?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Category (or tag) IDs as selectors in post meta?

This topic is: resolved

Tagged: categories, css, tags

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 6 months ago by tommyvallier.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 5, 2015 at 1:47 pm #158429
    tommyvallier
    Member

    Hi,

    Is there any way (plugin or a theme altering - I'm using Wintersong) to use the category IDs as CSS selectors? I'd like to set a different colour for each category and could easily do this through CSS... but the categories don't seem to have selectors unique to them for me to do this (like widgets would with text-widget or text-widget-3).

    Alternatively, can I do this with tags (and then just treat tags as categories)?

    The end goal would be something like this screenshot: http://imgur.com/9hFmcR0.

    Thanks for any help!

    http://imgur.com/9hFmcR0
    July 5, 2015 at 2:25 pm #158434
    Tom
    Participant

    Hi Tommy,

    You can do this by selecting for the category or tag slug. It's a bit of a pain because each new category or tag means adding a new CSS statement, but it works.

    For example:

    .entry-categories a,
    .entry-tags a {
    	padding: 2px;
    }
    
    .entry-categories a[href*='category-1'] {
    	background-color: pink; 
    }
    
    .entry-categories a[href*='category-2'] {
    	background-color: lime; 
    }
    
    .entry-tags a[href*='images-right'] {
    	background-color: chocolate; 
    }
    
    .entry-tags a[href*='images-centered'] {
    	background-color: yellow; 
    }

    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

    July 5, 2015 at 3:06 pm #158437
    tommyvallier
    Member

    A pain it might be... but it's working flawlessly. Really, once the 10 or so categories are set up, I don't plan on adding/removing any for a while.

    Thank you!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble