Skip to main content

Unanswered Questions

1,830 questions with no upvoted or accepted answers
2 votes
0 answers
357 views

Refresh Taxonomies

When saving/updating a custom post type in the Admin Panel I'm hooking into save_post_{$post->post_type} and adding custom taxonomy terms from a linked post using wp_set_object_terms. The terms are ...
2 votes
0 answers
1k views

How to add pagination to wpbakery grid?

I have a theme with wpbakery page builder. I made a page to display blog posts using wpbakery grid. But I would like to display 5 posts per page and to use ajax pagination. I display 5 posts per page ...
2 votes
2 answers
2k views

Show post page only if the user has bought a specific product

I'm having troubles with Woocommerce. I need to sell videos. I've created virtual products with a link to a different post for each (no download as I prefer to embed the video on my website and to use ...
2 votes
1 answer
2k views

AJAX in plugin wp_send_json() sending html

I wrote a plugin that calls a PHP function from JQuery and the php sends a json response back to the Jquery using wp_send_json(). The functions are all called successfully, but the json request sends ...
2 votes
0 answers
175 views

Extending wp JavaScript base class to make a post request to a custom REST endpoint

I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in. I'm now ...
2 votes
0 answers
257 views

Multiple WP_Query loops with Pagination Not Working

Please can anyone help me out here? I'm really stucked with this code. I want to create a multi post loop on my home page with each loop having its own pagination. The first loop is for recent post, ...
2 votes
0 answers
49 views

Fix inefficient loop breaks post.php on form submit

As is, this loop works fine. Although I feel like its inefficient because it doesnt need to keep updating the nonce counter each time it loops, that only needs to be done once. So when I try and move ...
2 votes
0 answers
411 views

Display notification only once

I am trying to use the getItem and setItem method to display notifications in an array only once. It works for the first 5 notifications but once you go above 5 there are a few issues that arise. For ...
2 votes
1 answer
629 views

wordpress post loop in javascript

How can I put WordPress post loop Codes in javascript? function top_news() { echo '<div class="news"></div>'; $query = get_posts(array( 'showposts' => 3, 'type' => 'topnews' ...
2 votes
0 answers
758 views

Search user metadata with checkboxes via ajax (almost working)

I have created an ajax search form following some tutorials online, it is working but not exactly how I need it to. Here is where I got the search from. I have US states setup as a user meta field ...
2 votes
0 answers
2k views

Filter custom post type archive page with custom taxonomies (categories) with AJAX

I've created a custom post type (projects) with different custom taxonomies (projects' categories). I would like to create a categories' filter but with AJAX, so without reloading the page every ...
2 votes
0 answers
840 views

Auto Load New Posts

Currently pulling in my posts on to a static page via ajax and a wp page template. <?php get_header(); ?> <div class="row"> <div class="col-md-6 feed-left"> <div id="post-list"&...
2 votes
1 answer
142 views

Category archive page - loop through posts of certain tag (with pagination) - pre_get_posts

I have a category archive page (press), which I need to loop through posts of a certain tag (magazines). I tried to modify the query with pre_get_posts, but it is still just showing posts in the '...
2 votes
0 answers
2k views

admin-ajax.php returning error 400 namespaced callback

I'm writing a plugin and I'm getting an error 400 Bad Request from admin-ajax.php. I did some poking around in the Wordpress core about this and it seems where it's getting hung up is around line 85 ...
2 votes
1 answer
489 views

AJAX in Wordpress, sending coords data to MySQL and show after into map

I've spent some months trying to figure out how to get users geolocation and pass it into MySQL and so after being shown with markers on the map. I've got stuck already in passing the data through ...

15 30 50 per page