Skip to main content
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
Results tagged with
Search options not deleted user 54782

"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
0 answers
715 views

Memory size exhausted when extending WP_Query

I tried to create a class that extends WP_Query, but I got this error: Allowed memory size of 1073741824 bytes exhausted I've increased the memory size in wp-config.php but that doesn't affect. Her …
Ehsaan's user avatar
  • 288
8 votes
Accepted

Group posts by year in loop

This little snippet could help you. $years = array(); if( have_posts() ) { while( have_posts() ) { the_post(); $year = get_the_date( 'Y' ); if ( ! isset( $years[ $year ] ) ) …
Ehsaan's user avatar
  • 288
0 votes

Filter posts/pages by user_role array

You've used LIKE comparison method, that means every similar expression will be matched, including exact string and similar string. If you want to match exact string, you should use = operator. Exam …
Ehsaan's user avatar
  • 288