$wpdb post type and term query only works when there are no dashes or spaces in the term slug and title

In your code you are using “AND terms.name=”shorelineorwaterway” where I don’t think shorelineorwaterway is your term name, it could be your terms slug. So you can modify this by “AND terms.slug = ‘shorelineorwaterway’ and here inside inverted commas you can use hyphen. If you need to use term name then “AND terms.name=”Your Term Name” would … Read more

mysql query on wp_user and user_meta problem

In usermeta table WordPress stores many serialized data. So direct meta_value would not work I think. So try the below query- SELECT a.id, a.user_email, a.user_registered, a.user_login, b1.meta_value AS first_name, b2.meta_value AS last_name, b3.meta_value AS qualified, b4.meta_value AS referrer, b5.meta_value AS view_type, b6.meta_value AS ref_by, b7.meta_value AS wp_optimizemember_custom_fields FROM wp_users AS a INNER JOIN wp_usermeta AS … Read more

$wpdb->get_var not returning count

In your code it is actually counting the query you have inserted in $testargs. In your case you entered one. So it is giving you back one. If you need to get the count on WordPress users table then write the query like below- global $wpdb; $total_query = “SELECT COUNT(*) FROM {$wpdb->users} AS total_count”; $total … Read more

do I need to change the default database prefix?

If it is easy to do, best practice is to have all wordpress installs use their own DB. Yes it is mainly for security, but it also simplifies tasks like importing and exporting sites. If you must have several sites on one DB, then all of them have to have different prefix, and there is … Read more

Locally installing wordpress. Database problem

Please read this official article from WordPress. Some from there: Before resorting to desperate measures, there are a number of reasons for the WordPress white screen of death: 1. A Plugin is causing compatibility issues. 2. Your Theme may be causing the problem. 3. Your Theme directory may be missing or renamed.