Replace Parent Functions from Child Functions?

  • Anonymous

    #18118

    Hey Syahir,

    Another issue if you don’t mind helping.

    Using your example above, I encounter a problem when using two or more text widgets. The text widget names are different, ie “text-1, text-2, text-3.. etc.

    However, the class uses the same name. “widget_text”. I have been naming my little icons according to this name. So, I can’t have two icons both called “widget_text”.

    Anytime I create a new text widget, it will get a different name… but it will always pull that “widget_text” icon.

    How could I use different icons for different text widgets?

    Thank you!

    Mod

    Kenneth John Odle

    #18119

    If I may butt in…

    Yes, but each widget has a unique id tag, which is why he’s using #categories-5 .widget-title-icon in the css above. Each id tag is used only once on a page, so by targeting that specific id, you should be able to assign a different icon to each widget.

    E.g., your “Mozilla Firefox” widget is id="text-5", so by setting that first, you should be able to change just that widget’s icon.

    I think this will work.

    Mod

    Kenneth John Odle

    #18120

    Actually, I just looked at your css, and I see that you’ve assigned ‘widget_text.png’ to both widgets, so that may be the source of the problem. You could name them ‘widget_text_01.png’, ‘widget_text_02.png’ etc. Or even ‘widget_text_facebook.png’, ‘widget_text_firefox.png’ etc.

    Anonymous

    #18121

    Thanks Ken.

    Right. The id is what makes the association to the css file. So in my css, I have something like #text-5 { or #text-3 {. But the problem is they both pull the “widget_text” icons.

    So, how would I alter my function to call “numbered” widget_text icons?

    Anonymous

    #18123

    Here is how I use it in my css:

    #text-5 .widget-title-icon {
    background: url(http://www.joshlobe.com/wp-content/images/widget_text.png) no-repeat;
    display: block;
    width: 28px;
    height: 28px;
    float: left;
    margin-left: -10px;
    margin-top: -4px;
    padding-right: 7px;
    }

    The problem is my image name must be the same as the class name (the part right after “sidebar-wrap clearfix” when viewing from firebug.

Viewing 5 posts - 11 through 15 (of 15 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!