Search Results
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 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
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 |
"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.
0
votes
1
answer
501
views
URL to Post Archive of Custom Query
I have a custom query for a CPT, from which I can obtain an array of postid's.
I want a url to the archive of the CPT, which has the query result (i.e. the posts of the postid's in the array are show …
0
votes
URL to Post Archive of Custom Query
Answering my own question seems weird, but here is how I was able to achieve it -
function filter_posts_by_id($query) {
if ( !is_admin() && is_post_type_archive('CPT_NAME') && $query->is_main_query …