Skip to main content

Unanswered Questions

1,344 questions with no 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
0 answers
59 views

How to Replace Words with Hypertext Link But Ignore Previously Existed Links?

Auto-linking for "selected words" in the_content I am currently using the following code: function wp_affiliate_links($text){ $replace = array( '/ example /' => ' <a rel="nofollow" href="...
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
372 views

Make Categories a Dropdown Menu in Media Library

I would like the categories menu to appear as a drop-down in both the list mode and grid mode view of the Wordpress media library. As of now, it only appears as a drop-down in list mode. List Mode - ...
2 votes
0 answers
392 views

How to change the page break <!--nextpage--> URL from ../post/2 to .../post/page2/

I am referencing the WP codex here: https://codex.wordpress.org/Styling_Page-Links but cannot find a way to customize the post URL for page break ( ) feature. For exmaple: instead of the traditional ....
2 votes
0 answers
3k views

How to use wp_trash_post (or wp_delete_post) for deleting a (or all) post(s) from custom post type?

I know, my question is general and here is some similar questions, I checked the all, but I dont find any solution for my problem... I try using the wp_trash_post() in my function.php, but for some ...
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
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
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
0 answers
984 views

How do I create a function that simulate the click on Update button for all posts?

I made a child function.php with this code. All new posts will automatically use the attachment id for the image I have uploaded to my Media Library. function wpsites_auto_set_featured_image() { ...
2 votes
0 answers
1k views

How to use max and min values of custom fields

How to use max and min values of custom fields (created via ACF, repeater type)? For axample, I've custom post type 'auto' and there are a lot of models. Each post(model) has few values of price (...
2 votes
0 answers
92 views

Trying to inject twitter metadata into <head> using wp_head action in functions.php - get_the_excerpt() returns null

So I followed the "Add Twitter Cards without plugins" this tutorial for how to add twitter metatags into the header using the wp_head method. I have pretty much taken the code as is, and put it in ...

15 30 50 per page
1 2
3
4 5
90