Posts modified in the last 48 hours

You can do it easily with WP_Query: $args = array( ‘date_query’ => array( ‘relation’ => ‘OR’, array( ‘column’ => ‘post_date’, ‘after’ => ‘-2 days’ ), array( ‘column’ => ‘post_modified’, ‘after’ => ‘-2 days’ ) ) ); $query = new WP_Query( $args ); More information about date_query parameter of WP_Query. If, for some reason, you still … Read more

Inner Join user tables to select users with roles

The Problems You risk SQL injection, with your current setup: $wpdb->users.display_name LIKE ‘$ltr%’ The following could also be a problematic part in your SQL query: AND $wpdb->usermeta.meta_value = %artist% i.e. using = instead of LIKE. You’re also missing the quotes: %\”artist\”%, to exclude e.g. bartist or fartist 😉 But you don’t need to construct this … Read more

Export SQL query based on post type

In your WordPress Dashboard, if you go to Tools > Export, you can select your custom post type and export only posts in that post type. It gives you the option between All Content, Posts, Pages, and your custom post types following those three options. As for SQL, well are you looking to export the … Read more

Better way to migrate to server?

I personally use BackupBuddy (a paid solution, from iThemes.com). For your scenario, you could install it on your local dev machine, and perform the following one-time actions: Add a one-time configuration for your server as a “Remote Destination” (including FTP/sFTP credentials and target directory). Copy an ‘importbuddy.php’ script to your remote server. Then, whenever you … Read more