Unanswered Questions
1,681 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
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
1
answer
143
views
Can I create customizer setting that can handle plugin shortcode?
Can I create a customizer setting which will handle a shortcode from a plugin? Do I violate and rules or guidelines in WordPress theme development?
If it's possible what is the best way to sanitize ...
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
0
answers
105
views
Can I strip HTML tags in the "Compare Revisions" screen?
I am building a CMS for content editors that have zero tech savvy. They currently use a system called NewsCred that allows them to compare revisions much like how WordPress does when you visit /wp-...
3
votes
1
answer
104
views
Changing a function in function.php to a shortcode - for listing categories of only a certain post type
I'm trying to create a shortcode that can display a list of categories. However, it should:
First, limit the results to a specific post type (based on shortcode usage)
then check to see if category ...
3
votes
0
answers
394
views
How to fix wrong attribute error for Visual Composer Grid Builder?
Hello I am facing this issue in editing media grid layout of Visual Composer V6.2.2. Below is the error I am getting
Fatal error: Uncaught Exception: Wrong attribute for 'vc_single_image' shortcode. ...
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
1k
views
Is it possible to intercept all ajax requests and get the parameters and the returns?
Is there any hook that always goes through it, where I can see all the requests, and also the returns after the "action" that is executed?
I need to intercept all requests, including requests from ...
3
votes
1
answer
2k
views
How to Use JSON With AJAX?
I've defined a PHP callback function to handle the communication between server-side and client-side:
function json_render_modal_body() {
check_ajax_referer( THEME_PREFIX . '-modals', 'nonce' );
...
3
votes
1
answer
2k
views
Shortcodes not working in an AJAX call
I am using AJAX to load next set of posts on homepage. The posts load fine but the shortcodes are not rendered. I am trying to use the do_shortcode function on the content the ajax call fetches (...
3
votes
2
answers
406
views
Calling shortcode in wp_localize_script strips result
I am working on adding some functionality on a Wordpress plugin which after a certain click needs to call on some shortcode through ajax.
What I first attempted was to call the shortcode inside of ...
3
votes
0
answers
182
views
WP REST API route request explain
Maybe can someone explain or show additional info about "WP REST API route request" from beginning to the end.
Main questions, how handle this request in most earlier stage. For example for ajax ...
3
votes
0
answers
1k
views
Setting TinyMCE Content in wp_editor
I am currently coding on front-end editing in wordpress. The outcome should be evernote-like editing using wordpress posts.
The Wordpress database stores markup without paragraphs and adds them on ...