My archives page won’t sort posts by month
My archives page won’t sort posts by month
My archives page won’t sort posts by month
You need to identify the tables for each of the columns that have the same name. You should also be using an IN statement and not = for the department. I can’t test this since I don’t have your DB but you can try this: $sql = $wpdb->get_results(“SELECT * FROM ” . $wpdb->prefix . “dir_personnel … Read more
How to do a sql like query on serialized data of user meta data
You will pass the $wpex_query object into wpex_pagination function. Currently $wp_query object is not getting your custom query details. Here is the updated for wpex_pagination function. if ( !function_exists( ‘wpex_pagination’ ) ) { function wpex_pagination( $new_query ) { $prev_arrow = is_rtl() ? ‘→’ : ‘←’; $next_arrow = is_rtl() ? ‘←’ : ‘→’; global $wp_query; $temp_query … Read more
So i got the answer and solution here https://stackoverflow.com/questions/55142768/sql-for-wp-to-delete-users-with-multiple-meta-keys-and-comments/55142835#55142835 SELECT u.* FROM wp_users u WHERE NOT EXISTS (SELECT 1 FROM wp_usermeta um WHERE u.ID = um.user_id AND um.meta_key IN (‘metakey1’, ‘metakey2’) ) AND NOT EXISTS (SELECT 1 FROM wp_comments c WHERE u.ID = c.user_id );
query_posts() is going to alter the main query, and it doesn’t sound like you want that. I would recommended using the WP_Query object to get the other posts. That said, if you must use query_posts(), call wp_reset_query() at the end of your foreach to reset your main query back to the original one.
PHP Fatal error: Uncaught Error: Call to a member function insert() on null
‘orderby’ => ‘post__in’, ‘post__in’ => array(5,6,3,8), You need ACF to pass the ID’s in order but that should do it.
I ended up using a simple meta_query: $args = [ ‘post_status’ => ‘publish’, ‘post_type’ => $post_type, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘my_acf_field’, ‘value’ => $search_term, ‘compare’ => ‘LIKE’ ), ) ]; $query = new WP_Query($args);
SQL to Query the db and return all posts and it’s metas