Skip to main content

Unanswered Questions

3,184 questions with no upvoted or accepted answers
6 votes
0 answers
636 views

How to load paginated post pages via ajax

Here's the case I got: I've setup post pagination for my website and everything works well. Except one thing - on every new page request all the resources are loaded again. This makes the website ...
5 votes
0 answers
6k views

How to get_terms() only of terms matching an ACF meta value?

My custom taxonomy "company" has an Advanced Custom Fields field group with fields including a Checkbox, "tags". (This adds to each "company" term fields including "tags", which accepts multiple ...
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
5k views

AJAX handler throws 400 (Bad request) - why?

I am trying to apply a "Load more posts" function to a post loop, but I am dealing with a 400 Bad request, when admin-ajax.php is referred to. The reference I used is this - https://rudrastyh.com/...
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
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
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 ...
3 votes
0 answers
569 views

ACF won't load from a custom JSON location

I’m trying to set up local json sync with ACF on a multisite installation. It worked with the default acf-json folder in the child theme, but I’d like to save and load everything from the parent theme....
3 votes
0 answers
1k views

ACF Upload Image in repeater from front-end with custom form? - add_post_meta()

I want to upload images in the ACF repeater. That repeater means the gallery of page. Point is to create post in custom post type using add_post_meta() method. Here I have the form : <input type=...
3 votes
0 answers
572 views

Solve cors problem using rest api or ajax

I'm building an app with nuxt using WP as a CMS, so I have this code in my functions.php to allow any origin (temporary) using the rest api and admin-ajax urls function add_cors_http_header(){ // ...
3 votes
0 answers
833 views

Remove WordPress/Gutenberg button styles for ACF blocks

Is there a way to remove the default styling of the gutenberg editor? I am building a custom theme using ACF blocks, part of one of the blocks has a button that is being displayed from the template ...
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 = ...

15 30 50 per page
1
2 3 4 5
213