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 answers only user 31545
3
votes
As I can understand, cpt_tag is only assigned to the custom post type cpt. This makes things much easier and less complicated. You do not need two queries and you don't need to merge anything Here is …
answered May 6 '15 by Pieter Goosen
1
vote
You have a couple of issues here. As your code stand, $post is undefined. It is actually better to make use of get_the_ID() to get the post ID instead of $post wp_get_post_terms() makes an extra db …
answered Jul 5 '16 by Pieter Goosen
0
votes
I'm not sure what you exactly need, but normally, by default, get_terms returns only terms that actually have posts assigned to them $terms = get_terms( 'exhibition' ); var_dump( $terms ); Apart fr …
answered Oct 21 '15 by Pieter Goosen
1
vote
You should take your third query outside the first // We will now run the second query if $count is less than $total_posts if ( $count < $total_posts ) { condition. You should also need to update t …
answered Mar 4 '16 by Pieter Goosen
0
votes
I'm not sure how you set up looks, but it does seem that you have a lot of taxonomies registered to your post type, so I don't think it will be very viable to use the the exclude parameter in get_term …
answered Mar 2 '15 by Pieter Goosen
4
votes
As already hinted by @Milo, check if you have terms before appending your tax_query You can try the following: (Requires PHP 5.4+ due to short array syntax, revert to old syntax if necessary) $args …
answered Jul 25 '15 by Pieter Goosen
3
votes
You cannot do this in one query, this is a bit too advanced for what WP_Query can do at this point in time. We will need to run at least two (I'm going to use 3) queries here to achieve what you want …
answered Mar 3 '16 by Pieter Goosen
6
votes
I'm not sure if this is a bug, but it need further investigation. I've run a few quick tests on the name field in a tax_query, and whenever a term name has got a special character or have more than on …
answered Mar 10 '15 by Pieter Goosen
1
vote
This is a really interesting question, which can result in a very expensive, resource intensive process which can really slow your page down dramatically PRELUDE All my code in this question is base …
answered Feb 15 '16 by Pieter Goosen