Skip to main content

Unanswered Questions

3,233 questions with no upvoted or accepted answers
10 votes
1 answer
983 views

Custom Taxonomy Endpoint Pagination using paginate_links()

The Setup I have 2 taxonomies and 1 post type: Post Type: products Hierarchical Taxonomy: product_cat Nonhierarchical Taxonomy: product_type The product-category has a defined endpoint: ...
5 votes
1 answer
1k views

Order wp_query by calculated field

Hi I'm working on a store locator. I have a custom post "clinics" where I save clinic details (address,.., lat, lng). Each time I publish a new clinic I save post_id, lat and lng also in a custom ...
5 votes
1 answer
12k views

wp_query->max_num_pages always returns 0 on custom post type

Hi there I am developing a theme where I have to load some posts with ajax, in my index page everything works properly, the problem is when I need to use it on custom post type, I pass the values for ...
5 votes
1 answer
4k views

I want to load post content by categories using Ajax

I have question. I would like to load post content, custom post, depends on category. So first of all I would like to have drop down menu which will list all my categories then once user will select ...
5 votes
2 answers
790 views

Extending WP_Query — Optimise SQL query

I'm storing posts, a user follows in a custom table that has the columns id, post_id and user_id. To fetch posts that a user follows I have extended the WP_Query as follows: class ...
4 votes
1 answer
3k views

WP_Query min and max values

I'm building a houses class and I want to filter these houses with a query. But don't get any results: Example house: Min price: 10 Max price (field not required): empty I've a price filter ...
4 votes
1 answer
666 views

Custom taxonomy query for a custom post type

I have a custom post type called news with a custom taxonomy called news category. Right now I have a template called taxonomy-news_category-press.php where press is one of the news_categories. The ...
4 votes
1 answer
2k views

has_term or in_category for Custom Post Types

I have property as a custom post type. I want to display a specific message if the property is in the sold category. To do that, I'm using the function below: if ( has_term('sold', 'category')) { ?&...
4 votes
2 answers
2k views

How do I order pages and categories by ID or name in the same query?

I would like to query most of my pages and categories on the homepage. So far I am able to get the pages and category (posts), but I cannot order the list the way I want to. I want to be able to get a ...
4 votes
1 answer
104 views

Is it possible to have a taxonomy archive that lists taxonomy terms?

For example, I have a post type called foo. I can view all posts of type foo at the following url: mysite.com/foo. I then attach a taxonomy called bar, in which the terms are foobar and foobaz. I ...
4 votes
1 answer
1k views

Custom taxonomy on permalink

I have a long time problem and look forward for your help. I have a custom taxonomy of "city" (it is no hierarchical like tags). I just would like my URLs to look like this: /%city%/%category%/%...
4 votes
1 answer
644 views

Get page content by category or tag

I'm trying to sort of emulate the Views behaviour in Drupal with WordPress, but doing it in theme templates. Now, I have pages that are assembled by using wp_query in the template to get posts ...
4 votes
0 answers
609 views

How to reload a select box of posts dynamically?

I'm using custom meta boxes for a project. I have created a custom taxonomy (select box) and I have another select box populated with Posts. I need to only load the posts based on the selection of the ...
3 votes
1 answer
3k views

How to get orders with used coupon in WooCommerce

Im trying to get orders in WooCommerce (ideally through wc_get_orders) where the coupon code "some_code" was used. My try: function get_orders_with_coupon($coupon){ $customer_orders = ...
3 votes
1 answer
897 views

Bulk 301 redirect for custom post type

I've amended the URLs for my custom post type from: url.com/jobs/job-name to url.com/jobs/job-location/job-name Problem is, because this isn't a standard rewrite wordpress doesn't do the 301 ...

15 30 50 per page
1
2 3 4 5
216