• I installed a Featured Posts widget (simple-featured-posts-widget.1.3.2). Once installed and activated on the page, all of the post titles in the list appear in red. This is because they are links and the default link color in my CSS is red.

    I do not want to change the default link color, but realize I need to insert some CSS code to only change the link color in the post titles appearing in the widget. I have tried a number of variations of code, but nothing I’ve tried works.

    I will buy a hot cup of Starbucks for the first person that can help me with this.

    Thanks!

    Michael

Viewing 6 replies - 1 through 6 (of 6 total)
  • You don’t need to buy me Starbucks, but if you could provide a link to your site, I’ll try to help.

    Thread Starter mcaravaglia

    (@mcaravaglia)

    Stephen,
    You are the man! The site is on a temporary server at “sjol.mcsquaredprod.com“.

    At the very bottom is a Widget called “Publisher’s Blog” and as you can see the text is all in red. This is because the default link color is in red and these are links to the posts. I want to keep the links, but change the copy to the same color as the body copy in all of the other posts, widgets, etc. Certainly, if I can add a roll-over state, that’d be nice too.

    I’m pretty sure the way to do this is by adding CSS code to the Theme to address the copy in this Widget, without effecting any of the default colors defined in the CSS, but I’m not strong enough with CSS to get the code correct.

    I have a similar issue with the widget just above this one, where I’m trying to get rid of the title (Find a Job) and the RSS Cube logo. For the life of me I cannot find this in the .php file for the Widget to remove it. I’m sure it’s in there and I just don’t recognize it.

    Michael

    To clarify, are you referring to the section that has the image of Edward Hertzman and has the text “Study Finds Nilit Innergy Nylon Fiber Beneficial to Body” and “Bangladesh: Factory Upgrades Expected to Cost $3 Billion”? If so, you can target just that widget without affecting the rest of the site by using some more specific CSS:

    #featured_category_widget-2 a {
    color: #333;
    }
    
    #featured_category_widget-2 a:hover {
    color: #ed1c24;
    }

    And for the other widget, again, you can target just that widget using more specific CSS:

    #rss-2 .widget-title {
    display: none;
    }

    You should make these changes in either a custom CSS plugin or your theme’s built-in custom CSS option, if one exists. If you edit the theme files directly, you’ll lose these changes if the theme is ever updated, to fix security issues or bugs or to add new features.

    Thread Starter mcaravaglia

    (@mcaravaglia)

    I will give this a try. Thank you so much. I’ll let you know how I make out!

    Thread Starter mcaravaglia

    (@mcaravaglia)

    Stephen,
    Interestingly enough, it didn’t work when I entered it into the Theme’s CSS; however, the one plug in has a custom CSS field and when I entered the same code there, it worked like a charm.

    The other one, “RSS-2” also did not work when placed in the Theme’s CSS file and there is no allowance for it in the widget itself, so I’m not sure how to fix that one.

    A very good thought on not editing the Theme’s CSS due to updates, etc. Apparently, the Themes does not seem to have any place to add custom CSS, so I’ll look into a plugin for that; thanks for the suggestion.

    On that same subject, I assume editing a Theme’s php files will also be a problem if the Theme gets updated. Inevitably though, some of the .php needed editing to get this where I needed it. No plug-ins for custom .php, I assume?

    I’m very grateful for your help; very generous of you to invest your time helping people. Please let me know if there is a way for me to repay the favor ??

    Michael

    You can setup a child theme if you’d like to edit a theme’s PHP files without worrying about them being overwritten when a theme is updated. If you need help getting a child theme set up, we can try to help here, though you might have better luck speaking with your theme’s author as no one here has access to your particular theme.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CSS Styling in Widget’ is closed to new replies.