Change Post Status From Front End

Simply replace wp_delete_post( get_query_var( ‘postid1’), true ); with wp_update_post( array( ‘ID’ => get_query_var( ‘postid1’ ), ‘post_status’ => ‘draft’ ) ); That is assuming that the rest of your logic does already work.

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

How to list recent posts in a wp nav menu?

What about checking the ID value of each menu item like the following: if( $item->ID === 45): // ADD THIS MENU-ITEM ID CHECK // Query the lasts ten category posts $category_ten_last_posts = array( ‘posts_per_page’ => 11, ‘category_name’ => ‘mamba’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ); $posts = get_posts( $category_ten_last_posts ); foreach ( $posts as … 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