How to filter the terms to a special custom taxonomy?
How to filter the terms to a special custom taxonomy?
How to filter the terms to a special custom taxonomy?
The most efficient means would be to query directly via wpdb: $author_ids = $wpdb->get_col( ” SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type=”job” AND post_status=”publish” ” );
add_query_vars does not work
The problem here is not that the posts that are being wrongly displayed are displayed under the wrong category, it’s that they’re not actually in the right category. For example, the post “Supporting healthy eating choices” is displayed under “O” as it has the category “O”. Going to your backend and assigning the proper category … Read more
This doesn’t seem terribly efficient but you could just look up the next/prev posts in the loop used to display the post then output the post titles in the nav calls. // loop if ( have_posts() ) : while ( have_posts() ) : the_post(); // … post display // next & prev post data $older … Read more
function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-5377’ ); $query->set( ‘orderby’, ‘date’ ); $query->set( ‘order’, ‘DESC’ ); } } add_action( ‘pre_get_posts’, ‘exclude_category’ ); Use ASC or DESC for order. Add code to child themes functions file. Tested and works.
Try adding the following code to the top of your search.php template below the get_header() call: <?php global $query_string; $query_args = explode(“&”, $query_string); $search_query = array(); foreach($query_args as $key => $string) { $query_split = explode(“=”, $string); $search_query[$query_split[0]] = urldecode($query_split[1]); } // foreach $search = new WP_Query($search_query); ?>
You’ll want to have a look at get_the_terms(). <?php // You need to define the post id from the post you are outputting in the right bar so that the left bar knows how to match up the terms $country = get_the_terms( $post->id, ‘countries’ ) $args = array( ‘post_type’ => ‘side_menu’, ‘posts_per_page’=> 1, ‘tax_query’ => … Read more
Tax Query not working
Get a list of the last posts grouped by author and filtered by category