Drop down list code for sidebar

Well, in a “layman’s” terms, you need to add your preferred filter (specific category id and order) to the $args array, like so: $args = array( ‘numberposts’ => ‘5’, ‘post_status’ => ‘publish’, ‘cat’ => 5, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’ ); The ‘cat’ should be the id of the “specific” category you want to … Read more

Remove all video attachment, both files and post/postmeta from database?

You call wp_delete_attachment passing $attachmentid which is undefined, so it can’t work… Also the $force_delete variable isn’t defined anywhere in your code. Also there is no point in using normal loop in here – you don’t use template tags in this action, so calling the_post is just a waste of resources… add_action( ‘set_user_role’, function( $user_id, … Read more