Does WordPress remove draft status automatically?

Just by itself WordPress will not change the post status. However, if you have a plugin like Draft Scheduler installed, drafts will be published automatically, possibly with some interval. So, you should check your plugins on this type of activity. Another possibility would be that a backup of the database has been installed after a … Read more

How to Customize number of blog posts on first page?

There is no option to change the number of posts per page, archive, tag or category from the admin but you can use query_posts() posts_per_page to set the number. for example in your theme’s index.php file or if you are using a static page as your home_page the page.php file add this snippet of code … Read more

Use Cron to modify posts via sql

Creating your own schedules is a little messy (because they need to be persistent and stored in database), but it is quite easy to hop on one of the native schedules that run twice a day. add_action( ‘wp_version_check’, ‘my_function’ ); function my_function() { //stuff } As for running actual queries you should use $wpdb for … Read more

Populating a page with content from post custom fields

I suggest using shortcode, as this’ll easily allow you embed the song list anywhere in your content, in any page or post. UPDATE: I got a little carried away, and ended up with this! function song_list_shortcode( $attrs ) { $r = ( object )wp_parse_args( $attrs, array( ‘format’ => ‘%post_title – %link’, ‘link’ => ‘%song_key_name’, ‘key’ … Read more

Limit amount of results returned

$images = $wpdb->get_col(” SELECT ID FROM $wpdb->posts WHERE post_type=”attachment” AND ID in ($meta) ORDER BY menu_order ASC LIMIT 5 “); Like @Kaiser suggested you can specify a range (5th to 20th results, a total of 15 results are returned at max) like this: $images = $wpdb->get_col(” SELECT ID FROM $wpdb->posts WHERE post_type=”attachment” AND ID in … Read more