• I think I may trying to do the impossible here, as I have searched around as found zilch about it!

    I just wanted to know if it is possible to apply Css styles to a Category Description.

    I’m currently using html tags, but it is very slow going, just trying to find a quicker option.
    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • What theme are you using? Can you post a link to your site?

    Thread Starter graham333

    (@graham333)

    Hi Stephen,
    thanks for the swift reply,
    Theme is 2012 default, I cannot post a link it is not live yet.

    Can you clarify exactly which text you’re trying to change? You could post a screenshot to a place like Imgur and post the link here.

    Thread Starter graham333

    (@graham333)

    Hi again,

    okay sorry I’m not clear, I’m sure you already know how the Category description is formatted by default, i.e. it isn’t.

    All I really want, is for the descriptions to have exactly the same styles as a normal Post/Page, i.e. h-tags, paragraphs, text styles, un-ordered lists etc, that’s all, nothing fancy.

    Are you referring to the description that you can add to a category at Dashboard > Posts > Categories > Add New Category? If that’s not it, can you post a screenshot showing which text you’re referring to to a place like Imgur and post the link here?

    Thread Starter graham333

    (@graham333)

    Hi Stephen,
    Yes that’s correct, just there.

    for you to use html tags in the category description, i.e. use formatting, you would generally need a plugin:
    https://www.ads-software.com/plugins/search.php?q=category+description

    you might additionally need to add some corresponding CSS to your child theme’s style.css or via a custom CSS plugin.

    Thread Starter graham333

    (@graham333)

    Sorry for the late reply on this thread.

    On reflection I think I probably asked the wrong question, so let me try again from a different angle.

    Okay I have some code in place that will allow me to use HTML in the Category descriptions, that works fine.

    But it seems no matter what I try, the 2012 theme CSS is overriding everything I put in the .archive-meta selectors except for background/text colour and font size across all the content including h tags.

    So what I’m asking now is, how can I style the <h> and <a href> tags in the Cat descriptions separately and apply that css to the archive-meta selector(s)

    Alternatively

    Can I force the default Page/Post global Css styles as they are (and appear on the pages) into the description instead, thus making the Category description display like a normal Post/Page

    According to Firebug, these are the selectors:
    .archive-header,
    .page-header
    .archive-meta

    In my Css file I have…

    header.archive-header  { background: #E8E8E8; }
    
    .archive-meta {
    	color: #000000;
    	font-size: 16px;
    	font-size: 0.857142857rem;
    	line-height: 2;
    	margin-top: 22px;
    	margin-top: 1.571428571rem;

    Changes made to this code are reflected in the Cat description, but adding tag styles does not seem to work, unless I am doing it wrong which would be no great surprise ??

    If you remove the lines in your CSS that refer to rems, that should allow your font sizes to change correctly. Other than that, I can’t see anything particularly wrong with your CSS. You could target tags within the .archive-meta sections individually:

    .archive-meta a {
      color: orange;
    }
    
    .archive-meta h2 {
      color: orange;
    }

    so that your styles won’t affect other tags on the page.

    Thread Starter graham333

    (@graham333)

    “If you remove the lines in your CSS that refer to rems, that should allow your font sizes to change correctly.”

    Bingo!

    That’s got it, thankyou so much Stephen, I have been persistently persisting around with that for ages, I thought it was the theme doing it. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Can I Apply Css Styles to a Category Description? Simple Y/N please?’ is closed to new replies.