modify a output of a widget

I would copy the widget from the core as needed, put it in the theme or plugin, but you should also unregister the core widget you are replacing. That can be done like this: // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); … Read more

How to execute SQL SELECT query and see the results?

Have a look at the $wpdb class, it does exactly what you want: $myrows = $wpdb->get_results( “SELECT id, name FROM mytable” ); Try to avoid SQL queries for basic operations though. WordPress offers you many convenience functions for 80% of the tasks you would every come up with. They provide a nicer interface and preserve … Read more

Different rss feeds in a single dashboard widget

Yes, @toscho is right, the url works with an array of feeds adresses. And if you have 5/6 feeds, the total of items should be 20/24. For clear separation, I think it’s better to run the wp_widget_rss_output function n number of times, and prepare a previous array with titles and addresses and iterate through it. … Read more

Big side banners

Register sidebars for the banners, then use the text widget to place your code in it. The default widget will strip some HTML code, so you may want to use something less invasive like my Unfiltered Text Widget.

Call sidebar from a template

Impossible with get_sidebar(). From that function’s body: function get_sidebar( $name = null ) { do_action( ‘get_sidebar’, $name ); $templates = array(); if ( isset($name) ) $templates[] = “sidebar-{$name}.php”; $templates[] = ‘sidebar.php’; So if you pass a $name or any other custom value to the function, they will be set between two fixed strings. You can … Read more

is_active_sidebar() Always Returns False

The is_active_sidebar(‘Test’); function works correctly if the correct slug is used. I think that the problem is that you are constructing the sidebar ID like this: $sidebarID = preg_replace(“/[\s_]/”, “-“, strtolower($page->post_title)); Then prepending sidebar- to it … register_sidebar(array( ‘name’ => $page->post_title, ‘id’ => ‘sidebar-‘.$sidebarID, // But you are using the unmodified title as the slug … Read more

Custom shortcode in widget forced to top of widget

For shortcodes you have to return the output for it to be written out where the shortcode appears. Either turn your HTML into a PHP string rather than breaking out of the PHP tags or you can use PHPs output buffering methods like so: ob_start(); ?> <div id=”player_<?php echo $id; ?>” class=”video_player”><a href=”http://www.adobe.com/products/flashplayer/”>Get the Flash … Read more

Current theme broken – after server and domain migration

Try the XCloner plugin: http://wordpress.org/extend/plugins/xcloner-backup-and-restore/. I use XCloner to move sites between my live server and my dev server. It takes care of all the migration differences between the domain, database, etc. It preserves all my widget settings, custom menus, etc.