Genesis framework comments broken?
Genesis framework comments broken?
Genesis framework comments broken?
When you look at the Codex article on $wpdb, then you will see that your current usage is correct. The last argument array( ‘%s’, ‘%d’, ‘%s’ ) already indicates that there is something like sprintf/printf going on in the background. The $wpdb->prepare() method isn’t needed for every other method. The ones that need it: $wpdb->query() … Read more
Is there a WP function to get taxonomy name from taxonomy_term_id?
It’s my fault. Got the solution after @Otto’s comment: Do you actually have a duplicate key here? What is the structure of user_req and what are the keys and indexes? Here’s how my SQL query should be: INSERT INTO {$wpdb->prefix}user_req ( user_id, post_id ) VALUES ( %d, %d ) WHERE NOT EXISTS ( SELECT * … Read more
Remove posts inside pre_get_posts using a custom query
delete duplicate comments
Pull data and display as rows and columns
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
I recommend backing up the database before making any major/bulk changes to it. First you need to get all users with the role “contributors”, then update their roles to “author”. $contributors = get_users(array(‘role’=>’contributor’)); foreach($contributors as $contributor){ wp_update_user(array( ‘ID’ => $contributor->ID, ‘role’ => “author”) ); } echo “done updating contributors to authors”; You could have this … Read more
I think the problem may be with your wildcards. Because you’re trying to use Wildcards in the prepare, which takes %s, the WPDP doesn’t know the difference between the wildcard % and the placeholder %. Using this answer as reference: How to use wildcards in $wpdb queries using $wpdb->get_results & $wpdb->prepare? You’ll have to double-escape … Read more