Tag Info

Hot answers tagged

2

If I'm not missing something, the below should work for you. It is pretty much straight from the Codex: WP_Query - Custom Field Parameters. Do it like this: $args = array( 'post_type' => 'post', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'color', 'value' => 'red', ...


2

Queries ofcourse. It's faster... But in this case just please delete you wp site and start with something faster... here is my superfast framework for you... <?php /*Your bunny wrote */ I did tests, 0.0000001 runtime vs WP usually 0.7-2.8 Sarcasm off P/S/ This question have no sence since using direct queries and output of the variables isn't use ...


2

This is all depends on what queries do you run on a page, are you using simple or complicated queries etc. There are really no set minimum or maximum amount of queries to a page. You will need to look in context of your site specifically and weigh the amount of queries to what is actually happening on your page. Wordpress can be quite harsh on resources ...


1

The use of wpdb->insert and wp_insert_post both accomplish an SQL Insert, which is why you're seeing 2 records each time. You must use only one instance of an insert method, and then Pass $my_post to WP_Query CLARIFICATION As Milo points out in his comment wpdb->insert will insert into any table, while wp_insert_post is used to insert a post into ...



Only top voted, non community-wiki answers of a minimum length are eligible