WordPress.org

Ready to get started?Download WordPress

Forums

Oxygen
How to change link color on certain pages? (7 posts)

  1. hydratelife
    Member
    Posted 1 year ago #

    I'm using the oxygen theme and I'd like to change the color of the links on certain pages. You can see an example of the links I would like to change here I know there's a built in way in oxygen to change the color of the links, but it changes all links. I'm not great at CSS but with some guidance can probably figure it out. Let me know if I can provide any more information to help.

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    You mean just the links inside the post ? if so, try putting this in your childtheme's style.css and change red to whatever color code you want.

    #post-884 .entry-content p a {color:red;border-bottom-color:red;}
  3. hydratelife
    Member
    Posted 1 year ago #

    Thanks paulwpxp. I'm trying to change the links on a page, not a post. I have a couple of pages that include only links, and i want to change the color of those links. Thoughts?

  4. hydratelife
    Member
    Posted 1 year ago #

    Further, if you follow the link above you can see that all the links are a light blue and they're kind of hard to see with the while background so I'm trying to change those links. I have several pages that are similar.

  5. paulwpxp
    Font hero
    Posted 1 year ago #

    In WordPress, when you say "post" it means content.

    For example, query_posts() is not only for post as in blog post, it's for content, any content in WordPress like post, page, attachment.

    The code I gave above is exactly for that page you linked to, just follow the same pattern for other pages that you need the same effect, do exact same thing with just different post-id ( again, post id is the same as saying page id )

  6. hydratelife
    Member
    Posted 1 year ago #

    Ok great! Thanks so much! that seems to be working. However, the code you gave me makes it so a line appears under the link when you scroll over it. Do you know how to make it so that the actual link changes color? I really appreciate all the help.

  7. paulwpxp
    Font hero
    Posted 1 year ago #

    makes it so a line appears under the link when you scroll over it

    Just assign transparent to border-bottom-color

    Keep in mind, though, what matters the most is accessibility, links should be noticeable as links.

    Also the mark-up for lists of links should be inside <li> not <p>, if you decide to make it right, then use this .entry-content li a instead of .entry-content p a.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic