• 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 6 replies - 16 through 21 (of 21 total)
  • So what do you guys recommend me to do? i don’t really understand sorry.

    I wrote a Twitter Widget, that might be instructive. Have a look at the code, and see if it helps. It is written using the Widgets API, which is the proper framework to use when developing custom Widgets.

    Thread Starter bidays

    (@bidays)

    Thats a cool widget thanks..
    but i can’t believe it still does the same thing: https://www.naimedart.com
    its not centered

    Thread Starter bidays

    (@bidays)

    I checked in functions.php in the themes folder and i didn’t really find anything usefulL.
    i forgot to precise that before getting this problem i changed the themes size.
    i added size to the left area ( content ) and removed some from the sidebar to make it smaller.
    Maybe i should of have changed something while doing this?

    Thread Starter bidays

    (@bidays)

    Nevermind thanks, luckily i could change the padding of the general widgets style under style.css and it doesn’t look so bad.
    although i would like to ask a question, how can i apply a independent style to a specific widget.

    although i would like to ask a question, how can i apply a independent style to a specific widget.

    That’s actually why I directed you toward my Plugin. ??

    If you look at this bit:

    function widget_cbnet_twitter_widget() {
            $widget_ops = array('classname' => 'widget-cbnet-twitter-widget', 'description' => 'Widget to display Twitter widgets' );
            $this->WP_Widget('plugin_cbnet_twitter_widget', 'cbnet Twitter Widget', $widget_ops);
        }

    You can see that WordPress will output a .widget-cbnet-twitter-widget class that you can target for CSS styles specific to this Widget.

    Thread Starter bidays

    (@bidays)

    Thanks i can now consider it as resolved. Thanks for your help

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