What triggers these wordpress queries on my homepage?

Are the queries themselves displayed or are the results displayed? If the results of those queries are being output onto your homepage it’s a potential security vulnerability. The query returns user data including username and password hash for user ID 1 of the wp_users table, which is the administrator user that WordPress creates when first … Read more

Order by meta values

You can do this by just looking for release_date_db: function plugin_name_get_posts() { global $wpdb; $the_posts = $wpdb->get_results( “SELECT * FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND meta_key = ‘release_date_db’ AND meta_value >= 20120000 AND meta_value <= 20121231 ORDER BY meta_value ASC;”, ARRAY_A ); }

Pagination in custom query not working [duplicate]

I believe the query var that you are retrieving should be paged and not page. See the codex and adjust your query to the following: $products_query = new WP_Query(array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 4, ‘paged’ => (get_query_var(‘paged’) ? get_query_var(‘paged’) : 1), )); However, if this is an archive for your product post type why … Read more

WP_Query search by multiple meta key and distance

You can do that. There are filters available in WP_Query that enable you to modify the query just as you like. The filter posts_clauses filters all of the parts of the query together. There are also filters specific to the parts of the query too. The best way to know about them is, search posts_clauses … Read more

WP_Query breaks pagination

If you want to stay with a new Wp Query, as in your example, changing your $allsearch name for the query variable to $wp_query should do the trick. Looks like the pagination functions are expecting that variable name for the query… So, try that…

How to query custom post then display sections by meta value

I would recommend executing two separate queries, each one differing from the other via a meta_query against your post custom meta key value. $current_query_args = array( ‘post_type’ => ‘recipient’, ‘meta_query’ => array( array( ‘key’ => ‘yes_current’, ‘value’ => ‘on’, ‘compare’ => ‘=’ ) ) ); $current_query = new WP_Query( $current_query_args ); if ( $current_query->have_posts() ) … Read more

issue displaying variations in custom template using WPeC 3.8.9.2

If you look at the default wpsc-products_page.php template, it uses while (wpsc_have_products()) : wpsc_the_product(); instead of have_posts() and the_posts() to setup the loop. The wpsc_the_product() function sets up a global $wpsc_variations object that the product variation functions use. I think in order to use wpsc_the_product() you need your query to be the global $wp_query, but … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)