Plugin is a widget, but I want to call it in the head, can I?

The correct “WordPress” way of doing it would be to use the_widget template tag to display widgets anywhere you want. so in you case you would something like this: $instance[‘account’] = ‘account name’; //Ustream channel name $instance[‘online’] = ‘http://www.online_image.URL’; $instance[‘offline’] = ‘http://www.offline_image.URL’; the_widget(‘wp_ustream_status’, $instance);

Don’t display html if function returns nothing

<?php global $related_posts_thumbnails; if ($related_posts_thumbnails->get_html()) { ?> <div id=”relatedproducts”> <h1>Related Products</h1> <?php get_related_posts_thumbnails() ?> </div> <?php } ?> A quick look at the get_related_posts_thumbnails() shows that it is simply echoing the HTML returned from the get_html() method of the $related_posts_thumbnails object. By checking the returned HTML first, you can make sure it is not an … Read more

Custom Post Type & Custom Menu Walker to append custom class for active post types

When i want to add the classes current-menu-item and current-page-ancestor i always use the wp_nav_menu without any custom walker. I only build my own walker if i want to change lets say the classes to something like “sel” instead. So i add the menu like this: <?php wp_nav_menu( array( ‘theme_location’ => ‘company-menu’, ‘container’ => false, … Read more

Make Current/Active Page Number a Link (WP_LINK_PAGES)

Doesn’t look like there are proper hooks to modify the output as per your requirements. But you could write a function similar to wp_link_pages() and call that in your theme. The following function would do your trick. function custom_link_pages($args=””) { $defaults = array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ … Read more