I cannot search users via user nicename
I cannot search users via user nicename
I cannot search users via user nicename
How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
From next_posts_link: Add the $max_pages parameter to the next_posts_link() function when querying the loop with WP_Query. To get the total amount of pages you can use the ‘max_num_pages’ property of the custom WP_Query object. next_posts_link( ‘Next →’, $connected->max_num_pages );
You can try to get that information by using the get_term_by() function with the relevant parameters of the menu item (namely object and object_id) : foreach( (array) $menu_items as $key => $menu_item ) { // Match the menu items to your custom taxonomy: if( ‘solutions_category’ === $menu_item->object ) { // Fetch the corresponding term object: … Read more
Why WP_Query in functions.php is not working when get_posts works?
You can simplify things by using the date_query of WP_Query(), instead of the posts_where filter. You can then try the following (untested): // Fetch from the ‘featured’ category $args = array( ‘posts_per_page’ => 1, ‘category_name’ => ‘featured’, ‘date_query’ => array( array( ‘after’ => ‘1 week ago’ ) ), ); $the_query = new WP_Query( $args ); … Read more
I don’t think your code does what you think, as it is only ever set to a single post from one of your loops. You description doesn’t really match that logic. To prevent duplicates you need to accumulate an array of IDs with each Loop. $do_not_duplicate[] = $post->ID; I think the space you are seeing … Read more
Issue with permalinks for custom post type
I had a similar problem with a featured section and ended up doing it like this Fist create your array variable outside the loop: $exclude_us = array() Then add the ID of each post in the first loop into the array (in the first loop): if ( $query->have_posts() ) : while ( $query->have_posts() ) : … Read more