Clicking “Show More Comments” loads the same visible comments [closed]
Clicking “Show More Comments” loads the same visible comments [closed]
Clicking “Show More Comments” loads the same visible comments [closed]
To get an array from a form POST into PHP, you have to name the form variable with square brackets: <html> <body> <pre> <?php var_export( $_POST ); ?> </pre> <form action=”” method=”post”> <label> 4<input type=”checkbox” name=”cats[]” value=”4″></label> <label> 5<input type=”checkbox” name=”cats[]” value=”5″></label> <label> 6<input type=”checkbox” name=”cats[]” value=”6″></label> <input type=”submit” value=”Submit”> </body> </html>
wp_nonce_field() is intended to echo out the nonce as a hidden field in your form, but above you seem to have it somewhere else. If you want to create a nonce outside of the form HTML you need to be using wp_create_nonce(). By default the API is expecting a nonce key of wp_rest. No idea … Read more
You are a bit unspecific in terms of where you are trying to execute the request. In case you want to GET data from an external point, you need to make sure that you are properly authenticated. In case you want to GET data internally, you need to make sure you are including the correct … Read more
Suggest to reformat the data like such (untested): function load_more_blogs() { … $results = array(); foreach ( $query->posts as $post ) { $results[] = array( ‘post’ => $post, ‘image’ => get_the_post_thumbnail( $post->ID, ‘post-thumbnail’ ), ); } wp_send_json_success( $results ); exit(); } This will give you an array of arrays, with the inner array have two … Read more
Have you already tried to flush permalinks? See https://www.wpbeginner.com/beginners-guide/how-to-regenerate-your-permalinks-in-wordpress/ Then I would start debugging the value of snek_results.ajaxurl
I figured it out. I was creating the form when a button was clicked. I had to put the replyform submit within that function. Working now.
So, I figured out why this only worked once, and not every time afterward. I have the ID and URL wrapped in a <span> with an ID and class tied to it. However when the if(response.success === true) { fired, and updated the ID and URL of the image, it overwrote the entire <span> with … Read more
Ajax load more post button not showing
WP_query with ajax filter not working with input fields