Show image exactly defined to a width

If $content_width is the problem, you could set it to something different if you’re viewing a single HQ post. function wpse99587_single_hq_post() { global $post; if( is_single() && in_category( ‘HQ’, $post->ID ) ){ global $content_width; $content_width = 900; } } add_action( ‘wp’, ‘wpse99587_single_hq_post’ ); // I dithered on where to hook this function; // if there’s … Read more

Force authors to Preview a post before publishing

This is completely untested but I think the concept is good, and good idea too though I’d have an angry mob with pitchforks to face. Set a marker for your post when the post is previewed. You can save it in either $wpdb->options or $wpdb->postmeta. I haven’t quite decided which would be better, and it … Read more

Display post x of y within category

Raw SQL is inconvenient. You can use get_posts() (or WP_Query which it wraps) with ‘fields’ => ‘ids’ (see fields parameter ) for lightweight counting, while retaining compatibility with all arguments it accepts, including category parameters

Display gallery on bottom after content

This is not bulletproof, but should work perfectly fine in most cases: class WPSE_105676_Gallery_First { private static $_gallery = ”, $_handler; public static function gallery( $attr ) { self::$_gallery .= is_callable( self::$_handler ) ? call_user_func( self::$_handler, $attr ) : ”; return ”; } public static function content( $text ) { $text .= self::$_gallery; self::$_gallery = … Read more

How to assign classes to all elements?

Jquery solution: **assuming your posts are in a division with the class of “post”. <script type=”text/javascript”> $(document).ready(function(){ $(“.post p”).each(function(){ $(this).addClass(‘paragraph’); }); $(“.post ul”).each(function(){ $(this).addClass(‘list’); }); //add more lines here to select more elements }); </script> Paste this in your footer. *you need jquery installed. And better yet would be to enque this using http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Call to undefined method – Download Monitor

It appears the issue was mostly with scope. In this case the following was needed to get the post ID: php $download->post->ID I then was able to get my meta value by using the following: php $active_sub_status = get_post_meta( $download->post->ID , ‘_act_sub’, true );