Browsing Category

Wordpress wp-query

Return only Count from a wp_query request?

Is it possible with the standard build-in tools in WordPress to get wp_query to only return the count of an query? Right now, I’ve a

global $wp_query; Returns Null

Firstly this question is different to this one as I’m talking about accessing $Wp_Query from outside of a loop. What I'm trying to do I’m

Query Set Order By Author

I am attempting to orderby the author_name when you click on the Author arrow on a list of tickets. When you click the arrow, the

Query only returning 1 result?

What i want to be returned is the top categories by sales(total_sales). For example if the category(taxonomy) ship has 64 sales, car has 45 sales

WP_Query custom order and pagination

I am seeing some strange behaviour when combining a custom order with pagination when using WP_Query. The arguments for my query are as follows: $args

Make a WP Query search match exactly the search term

I’m using WP Query and the results coming back when using the search term aren’t working as I wish. For example searching for ‘art’ returns

Get posts by tag OR with the given category

So I have posts & custom post types. They can be either categorized in fashion or tagged with featured. So I want to pull the

modifying meta_query on parse_query

In the parse_query filter hook I’m doing: if ( is_admin() && $pagenow == 'edit.php' && isset( $_GET['ysr_homepage_filter'] ) && $_GET['ysr_homepage_filter'] == '1' ) { if

WordPress exlcude post title like

I’m using woocommerce theme and with WP_Query i want to exclude results with post title LIKE “$postitle”, how do i do this? Here is my

WP_Query by post ID doesn’t work if post is in custom post_status

I want to display a single post by its ID using WP_Query(). To do this, I use the following argument: $args = array( 'p' =>

Pagination for custom query throws 404 errors on last pages

I’m using a custom query to get all CPT posts for the author in author.php. I have a lot of authors and a lot of

Whats up with this date_query?

There’s probably lots wrong with this - which I will come to realise on my own with some more coding knowledge. For the moment could

Order posts by custom column using pre_get_posts

Is it possible to sort posts by custom column in wp_posts table (in this case, ‘fav_count’ column) using pre_get_posts filter? If not, is there any

Sorting "menu_order" does not work in WP Query with multiple post types

When i use my WP Query as follows: $post_types = array('research'); $args = array( 'posts_per_page' => 10, 'orderby' => 'menu_order', 'order' => 'asc', 'paged' =>

If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?

So I have 3 custom post types that I want to order by menu_order & have ‘date’ as the fallback parameter as the majority of

WP_query Date Range results not matching loop

I have written a WP_query with a date range. $args = array( 'date_query' => array( array( 'column' => 'post_date_gmt', 'after' => array('year' => $after[0], 'month'

Back to Top 45370 wordpress questions, 32 Wordpress answers.
Wordpress related, All rights reserved
Powered by Creative Advertising