Support » Fixing WordPress » Add twitter code to a widget

  • Resolved bidays

    (@bidays)


    Hello,

    I am trying to create a widget just to add a twitter app code so that i can remove and place it wherever i want to.
    What am i supposed to add? Here’s the simple script i would like to add to a widget.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Thanks id advance.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Create a function to be called in the widget http://codex.wordpress.org/Widgets_API

    Ok I added it but the problem is that I can’t center the app
    Where is a photo :http://img688.imageshack.us/img688/113/capturedcran20120527221.png

    Can someone just tell me which file i have to modify?
    i dont understand what files the widget uses to get its style. I am looking for a css file
    to change the visual of the widget. as you can see on the picture i’ve posted earlier:

    :http://img688.imageshack.us/img688/113/capturedcran20120527221.png

    Thanks in advance.

    esmi

    (@esmi)

    Forum Moderator

    i dont understand what files the widget uses to get its style.

    From your theme’s CSS. Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

    Hey thanks a lot for that app. it works great.
    The only problem i have is that i only need to modify one widget, when i change the style in the style.css file it changes all widgets.

    What i think i have to do is to add a style for the widgets and copy the same parameters but changing the padding. I can do that.

    What i can’t find is where the widget’s style is called. I guess that each widget calls the same style under style.css
    Is this a good approach?

    Could someone tell me where to change that?

    thanks in advance

    Chip Bennett

    (@chipbennett)

    Theme Review Admin

    What i can’t find is where the widget’s style is called. I guess that each widget calls the same style under style.css
    Is this a good approach?

    Could someone tell me where to change that?

    We’d need to see the relevant Widget code, in order to answer that question. I assume you added your Widget using the Widget API (“widget-name extends class WP_Widget….”)? If so, we need to see the function widget() code from inside the class.

    well using the plug in firebird
    i select the widget after the title and this is what i get:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    is that what you mean?

    Oh sorry for that,

    here is the link paste bin for the code:

    http://pastebin.com/61VtZeFM

    esmi

    (@esmi)

    Forum Moderator

    Can we have a link a page showing this widget please?

    Yes you can visit the homepage as its on the sidebar:

    http://www.naimedart.com

    esmi

    (@esmi)

    Forum Moderator

    It’s the default padding on your sidebar widgets that is causing the problem but, in order to target any new CSS at that specific widget, you’d need to add a new class to that custom(?) widget.

    Chip Bennett

    (@chipbennett)

    Theme Review Admin

    It’s the default padding on your sidebar widgets that is causing the problem but, in order to target any new CSS at that specific widget, you’d need to add a new class to that custom(?) widget.

    …which, really, is what I was getting at above, by asking for the function widget() code. But, based on the Pastebin, I wonder if the OP isn’t actually using the Widgets API to create this Widget?

    esmi

    (@esmi)

    Forum Moderator

    That doesn’t look like it to me. But then I also noticed that the other widgets all use the same class. Perhaps the theme’s functions.php also needs to be modified to output a unique class or id for each widget as recommended by the Codex? It sure makes like easier long term.

    So what do you guys recommend me to do? i don’t really understand sorry.
    but thanks for you help though.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Add twitter code to a widget’ is closed to new replies.