Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
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 27423

"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.

1
vote
As the error states, your $my variable is not defined. The reason behind it is that you only defines $my when $the_query->have_posts(). Adding $my = 'No results found'; right after $the_query = …
answered Jan 14 '16 by Sladix
1
vote
Your arguments should look like this : $args = array( 'post_type' => 'product', // No need for an array since you only query one post type 'posts_per_page' => 3, 'tax_query'=>array( // The …
answered Nov 6 '15 by Sladix
1
vote
You can store the counts as key and link a value and sort them before display like this : $sort_tab = array(); while (have_posts()) : the_post(); if ( has_post_thumbnail() ) { the_post_thumbnail( ar …
answered Apr 27 '15 by Sladix
3
votes
If you want your main query to take in account your custom post type, you can do as shown below : function add_custom_post_type_to_query( $query ) { if ( $query->is_archive() && $query->is_main_q …
answered Jan 13 '16 by Sladix