Add New Footer Widget Area with Limited Options?

Widget areas are the wrong tools for what you need. They are built to offer a choice. Breaking that would be very difficult … and hard to understand for the user. Alternative: Use a custom setting, for example in wp-admin/options-general.php where the tagline and the site title is. There is even a hook for such … Read more

Registering multiple copies of a widget

You really need to be using the Widget API. Here is a widget shell to get you started. class WPSE_Widget_Shell extends WP_Widget { function __construct() { $opts = array( ‘description’ => ‘Brief description; shows on the backend’ ); parent::WP_Widget( ‘widget-id’, ‘Widget Name’, // shows on the backend $opts ); } function form($instance) { echo ‘backend … Read more

Multiple widgets in wordpress

Try to generate your div to have a value that makes clear what kind of content it loads, for example: <div class=”social-count” role=”facebook”></div> <div class=”social-count” role=”twitter”></div> Then, via jQuery, change them by that value, for example: $(‘.social-count[role=”facebook”]’).html(count); $(‘.social-count[role=”twitter”]’).html(count);

WordPress plugin not eching popular posts

one possibility is: public function popularPosts($num) { global $post; $args = array( ‘orderby’ => ‘comment_count’, ‘order’ => ‘DESC’ ); $posts = get_posts( $args ); $count = 0; foreach ($posts as $post): if($post->comment_count != 0 ){ $count++; } endforeach; if ( $count > 0 ): foreach( $posts as $post ) : setup_postdata($post); if($post->comment_count != 0 ){ … Read more

twenty twelve theme widgets not working

Your most likely having an issue with the plugins. These types of problems are extremely hard to diagnose. I had a similar problem with the WordPress theme Arjuna-X where it was loading it’s own modified JQuery library that was only breaking the switching of “Visual” and “HTML” in the post editor. Took me days to … Read more

WordPress function breaks widget’s markup?

wp_list_pages does not wrap it’s output in a ul or ol tag. That’s up to you. In other words, if you just call wp_list_pages, it’s going to spit out a bunch of li tags, which your browser assumes is wrong and “corrects” the html as it sees fit. Try this: function widget( $args, $instance ) … Read more