Here is the situation, I have a special tax called "Skill". I want to show messages with only a set of skills, like Japanese from English.
I am trying to learn how to use pre_get_posts hook to modify my get_posts request. Here is my example, however I am landing with an error:
Note: Undefined variable: postdata p>
Here is what I tried based on research:
add_filter( 'pre_get_posts', 'wpshout_fundraiser_recent_posts' ); function wpshout_fundraiser_recent_posts( $query ) { // Fetch only posts tagged with "Japanese from English" $taxquery = array( array( 'taxonomy' => 'Japanese from English', 'field' => 'skill', 'terms' => array( 'skill' ), ) ); $query->set( 'tax_query', $taxquery );
I am sure that something is wrong with the above request, which I do not quite understand. Any help and please explain why, if possible, each field of the array.
php wordpress
Elevant
source share