How can I add links to widget titles?

Making the title click-able WordPress won’t let you pass HTML code in the title of the widget, but it does have the handy parameters $before_title and $after_title that you can use to manipulate things. In your widget, just add the first part of the link (<a href=”…”>) to the end of $before_title and the last … Read more

Prevent second widget activation

You can create a one-time-use widget with the following example found here: wp_register_sidebar_widget The following code will create a widget called “Your Widget” which will become available in the WordPress Administrative Panels. The widget can then be dragged to an available sidebar for display. Note that this widget can only be used once in exactly … Read more

Get sidebar parameters (before_widget, before_title, etc.) from within a widget

The parameters are given (as an array) as the first argument provided to the widget method. The second argument, $instance, holds the options for that particular instance of the widget. My usual set up is: function widget($args, $instance){ //Extract the widget-sidebar parameters from array extract($args, EXTR_SKIP); echo $before_widget; echo $before_title; //Display title as stored in … Read more

Storing custom dashboard widget options in wordpress

Solution pulled from OP. Ok fixed. In widget-config.php there is no check if the form has been submitted, so every time you load configuration it updates with empty values or keeps default ones. Add this check if (!empty($_POST)) before updating options values and display stored value of number-input: <input type=”text” name=”number” value=”<?php echo self::get_dashboard_widget_option(self::wid, ‘example_number’); … Read more

How to override the wordpress default widget markup

http://codex.wordpress.org/Function_Reference/unregister_widget add something like this to functions.php: if (!function_exists(‘my_unregister_default_wp_widgets’)) { function my_unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Recent_Posts’); } add_action(‘widgets_init’, ‘my_unregister_default_wp_widgets’, 1); } Also… you can look at the http://codex.wordpress.org/Widgets_API examples to see how you can extend the WP_Widget class to create custom widgets that you want.

How do i manually place a widget code

Just register another widget area. Don’t take the name sidebar literally, you can use the fields anywhere on your page. In your theme’s functions.php: add_action( ‘after_setup_theme’, ‘register_multiple_widget_areas’ ); function register_multiple_widget_areas() { register_sidebar( array( ‘name’ => ‘Sidebar’, ‘id’ => ‘sidebar’, ‘description’ => ‘describe the function of the box.’ ) ); register_sidebar( array( ‘name’ => ‘Header’, ‘id’ … Read more