Disable dashboard drag&drop

This will remove the draggable functionality from each widget: jQuery(‘.widget.ui-draggable’).draggable(‘destroy’) You have find a good way to inject this into your code, either through wp_enqueue_script() or echo it inline on the Widget page. To target a specific Widget you would have to do something along these lines: jQuery(‘.widget.ui-draggable’).each(function() { if (jQuery(this).find(‘h4’).text() == ‘Archives’) jQuery(this).draggable(‘destroy’); } … Read more

Problem with empty class attributes when running a filter on nav_menu_css_class

Unfortunately there is no filter which can overcome this issue. You have to override the start_el function of the walker. Here is the original source: $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); $class_names=” class=”” . esc_attr( $class_names ) . ‘”‘; $id = apply_filters( ‘nav_menu_item_id’, ‘menu-item-‘. $item->ID, $item, $args … Read more

Disabling automatic teasers

Try using $post->post_excerpt instead: // globalize $post, just in case global $post; // find out if the post has a defined excerpt $data = $post->post_excerpt; // If so, output something if ($data) echo “<div class=”excerpt”>$data</div>”; This method will bypass the auto-excerpt generation inherent in get_the_excerpt(). EDIT By popular demand, the same code, using has_excerpt(): // … Read more

How can I wrap html around the output of the_time function?

Please see this documentation for the usage about the_time(). You are not supposed to add html inside the parameter of the_time(). (edit: use get_the_time() with in string concatenation) To solve this, try this code: echo ‘<div class=”post_date”><div class=”month”>’.get_the_time(‘F’).'</div>’.'<div class=”day”>’.get_the_time(‘d’).'</div><div class=”year”>’.get_the_time(‘Y’).'</div></div>’; edit: corrected to the use of get_the_time()

Implementing FancyBox

If you check your console for errors as @patnz suggested, you’ll likely see that $ is undefined. This is because WordPress loads jQuery in noConflict mode. Try this instead: <script> jQuery(document).ready(function($) { $(“a.fancy”).fancybox({ ‘transitionIn’ : ‘elastic’ }); }); </script>

WordPress theme switcher

This has to do with .htaccess rather than wordpress itself. You could just add a row to your htaccess files. RewriteRule ^(.+)/theme-(.+)$ $1?themedemo=theme-$2%{query_string} $1 is argument one, the first appearance of (.+) and is the page name $2 is the second argument, the second appearnce of (.+) as in the theme name so if you … Read more