Articles of widgets

How to add the widgets manually to the sidebar?

How can I add the widget manually in the code ?

WordPress “include TEMPLATEPATH” or?

I built something like this: Index Container Widgets Area and I created a widget for that – Categories Widget – Index Container .php with this in: <?php include (TEMPLATEPATH . ‘/includes/containers/container-grid-categories.php’); ?> <?php ///include (TEMPLATEPATH . ‘/includes/containers/container-list-categories.php’); ?> and for example in the /includes/containers/container-grid-categories.php is this: <?php //include (TEMPLATEPATH . ‘/includes/containers/container-grid-categories/grid-thumbs.php’); ?> <?php include (TEMPLATEPATH […]

Replace dashboard widgets with banner ad

I know it’s probably not encouraged, but is there a way to replace the standard dashboard widgets (Recent Drafts, Quickpress, etc.) with a standard image banner ad? I know how to add new dashboard widgets, but I want this to be a plain image with no surrounding widget.

Dynamic widgets

In wordpress is it possible to have different widgets on different pages, I mean, I am having a form widget which has to be just displayed on posts page, it should just display on single.php Is this possible? Is their any plugin for this?

How to put Stack Exchange Flair as widget?

I want to put my flair in as a widget in the top of my sidebar in my blog. There was a similar question asked here but the only answer links to the flair page and suggests copying and pasting the html into the theme. I don’t want to edit my theme, I want to […]

cannot drag and drop widgets since wordpress 3.2.1

I recently updated my site to wordpress 3.2.1 automatically. Now I tried to manage my sidebar widgets, and noticed I can no longer drag and drop the widgets around. If I look into my browser-console, I notice that the page is unable to load jQuery. Weird: it appends my root-url to the jquery-url, like so: […]

Style every second widget?

I need to apply a certain style to every second widget in my sidebar, and I’m reluctant to use :nth-child due to cross-browser compatibility issues. Is there a bit of PHP that will allow me to apply a class to every other widget?

How to determine which sidebar the widget has been added to, via widget admin?

In the script below, which resides in a custom widget, I’m trying to determine which sidebar area the widget has been added to because I want to alter the default text depending on which sidebar the user has added the widget to. This code should only execute on the admin side while editing the widget. […]

WordPress select dropdown list in widget

Ok, I’m developing my own widget and I’ve a HUGE problem. I don’t know how to fetch and eventually save html selects value. Simple example: /* initialize TITLE */ function widget( $args, $instance ) { extract( $args ); $title = apply_filters(‘widget_title’, $instance[‘title’] ); (…) /* update code for TITLE */ function update( $new_instance, $old_instance ) […]

How can I add an incremental class identifier to my sidebar widgets?

My sidebar widget code in functions.php looks like this… if ( function_exists(‘register_sidebar’) ) register_sidebar(array( ‘name’ => ‘Home Sidebar’, ‘id’ => ‘home-sidebar-widget’, ‘before_widget’ => ‘<div class=”menu side %2$s”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h4 class=”sidebarTitle”>’, ‘after_title’ => ‘</h4>’, )); Which creates this markup on the site… <div class=”menu side widget_text”> <h4>widget 1 title</h4> <div class=”textwidget”>Lorem ipsum […]