Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 113496

"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to WordPress which allows users to query the posts database using a number of criteria. 2) $wp_query is the global variable that holds the main query object prepared by WordPress based on a given request.

2
votes
The main problem is how you're specifying the custom table name (e.g., $wpdb->cf7dbplugin_submits). $wpdb only knows about the "built-in" tables when accessing a table name via $wpdb->xxx. To specif …
answered Apr 10 '17 by Paul 'Sparrow Hawk' Biron
1
vote
Your question is very unclear (given that you don't actually ask a question), but there are 2 problems with your code, both of which are corrected below: $args = array ( //'post_type' => 'art …
answered Mar 20 '17 by Paul 'Sparrow Hawk' Biron
1
vote
The simplest way I know is: global $wpdb ; $sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'" ; $count = (int) $wpdb->get_var ($sql) ; You could also use WP_Query, altho do …
answered Mar 10 '17 by Paul 'Sparrow Hawk' Biron
2
votes
Are you using ACF Pro (e.g., using it's "Date and Time Picker" field type), or one of the plugins that adds a date/time field type to "normal" ACF (e.g., Date & Time Picker for Advanced Custom Fields) …
answered Mar 27 '17 by Paul 'Sparrow Hawk' Biron
3
votes
In a taxonomy template, the queried object is an instance of WP_Term, one of whose fields will be the taxonomy the term comes from. So, you can start your taxonomy.php as follows: $queried_object = …
answered Mar 12 '17 by Paul 'Sparrow Hawk' Biron
0
votes
You've probably hooked into one of the WP_Query-related actions/filters (e.g., pre_get_posts) and altering the query when isset( $_GET[ 'partner' ] ) == true. Find a way to conditionally avoid that m …
answered Mar 14 '17 by Paul 'Sparrow Hawk' Biron
1
vote
There's so much going on it the code in your question that it's hard to follow. Plus, you don't say what happens when you use the shortcode more than once in a given page/post). Thus, I can't be sur …
answered Feb 25 '17 by Paul 'Sparrow Hawk' Biron
0
votes
I just noticed your comment that you wanted to accomplish this via a filter, so here you go (this basically expounds on the comments I've made on your original question and @DavidLee's answer). The f …
answered Feb 22 '17 by Paul 'Sparrow Hawk' Biron
0
votes
the_dramatist's answer will give you only top-level pages that have no children, which matches the example given in your description. However, if you want to get ALL leaf pages, use the following: S …
answered Feb 17 '17 by Paul 'Sparrow Hawk' Biron
1
vote
As written your question is off-topic, as it is purely SQL-related. However, the following 2 solutions translate it into WP-ese. Solution 1 $args = array ( 'post_type' => 'project', 'post_s …
answered Apr 16 '17 by Paul 'Sparrow Hawk' Biron
0
votes
The following should do the trick: global $wpdb ; // get the post_ids from the custom table $sql = "SELECT listing_id FROM {$wpdb->prefix}wpdbdp_listing_fees WHERE fee_id = %d" ; $sql = $wpdb->prepa …
answered Feb 20 '17 by Paul 'Sparrow Hawk' Biron
0
votes
You don't provide the context of where the code in your question is being used. Is it something like the following: $args = array ( 's' => '201701057', 'meta_query' => array ( 'relat …
answered Mar 14 '17 by Paul 'Sparrow Hawk' Biron
1
vote
If the taxonomies in question are used ONLY in the post_type in question, then the following simple function will do what you need: function count_term_use ($post_type) { $args = array ( …
answered Feb 17 '17 by Paul 'Sparrow Hawk' Biron