How to exclude categories from a sidebar with active widgets in it?

If i understand correctly, a quick solution could be using something like Widget Logic and create a custom menu for each category, then use whatever Conditional Tags applies.// such as is_category() or in_category( ‘5’ ) Or, if you don’t want to use a plug-in, you could try duplicating the widget and then adding the conditional … Read more

Modify pages widget and make a plugin?

Widgets are class based, so it is quite easy to extend them. Create your class by extending WP_Widget_Pages (just like it extends baseline Widget). Copy method(s) you want to modify into your class and make changes in there. You would probably want to extend and modify name and such so it is not confused/conflicted with … Read more

Jquery checkbox -show posts with checked tags

Grab and go, buddy! Had fun figuring this one out 🙂 Create a file and upload to your plugins. Call list_ajax_tags() in theme where you want to display these tags. Modify to suit your needs http://pastebin.com/3eZWEv5K (had trouble formatting the code here)

How to Catch Last Widget box From Same Widget Area?

Add the following code in your functions.php file of the theme directory. Replace widget name “Home Widget Area” with your widget’s name /*=============WIDGETs CSS CLASS CONTROLLER==============*/ $GLOBALS[‘my_widget_num’]=1; function edei_widget_class_adder($params){ if( $params[0][‘name’]==’Home Widget Area’ ){ $GLOBALS[‘my_widget_num’]++; if( ($GLOBALS[‘my_widget_num’]%4)==0 ){ $params[0][‘before_widget’] = str_replace(‘class=”‘, ‘class=”marginAdjust ‘, $params[0][‘before_widget’]); } } //print_r($params); return $params; } add_filter(‘dynamic_sidebar_params’,’edei_widget_class_adder’); function edei_widget_counter_reset($sidebars_widgets) { $GLOBALS[‘my_widget_num’] … Read more

Widget internal hooks and functions

Take a look at the default-widgets.php and widgets.php files from wp-includes folder. You’ll find a couple of filters and actions there which will help you. You’re gonna have to try them out, they aren’t documented. Create a list in array, preferrably of all widgetized areas and their id. – Use the filter sidebar_widgets, it will … Read more

Last x Posted Categories?

<?php $cat_array = array(); $args=array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 20, ‘caller_get_posts’=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); $cat_args=array(‘orderby’ => ‘none’); $cats = wp_get_post_terms( $post->ID , ‘category’, $cat_args); foreach($cats as $cat) { $cat_array[$cat->term_id] = $cat->term_id; } endwhile; } if ($cat_array) { … Read more

WP 3.3 RC1 new switch_theme() method foobars sidebars

Likely your code is somehow breaking on the new widget handling methods, which save old widget layouts when theme switches occur. http://wordpress.org/news/2011/11/wherefore-art-thou-widgets/ Most likely, you’ll have to switch themes before adjusting the widgets in it, since widgets don’t survive theme switches anymore, or at least, will be restored from older settings after a theme switch.