How to use: WP_AJAX_GET_COMMENTS

It is being used under wp-admin/js/post.js the function commentsBox.get. The purpose is to get Post comments. The UI related to it should be shown under the Comments page of WordPress. Though if you will further check the code, the selectors aren’t present there. So there’s no way you could use it just by calling out … Read more

Check if a new WordPress post is successfully published with jQuery

I have replace the answer I gave yesterday with this newly updated and tested version. I also added some code to test with that changes Publish to Update after 6 seconds. Please give it a shot. <input type=”submit” name=”save” id=”publish” class=”button button-primary button-large preventDefault” value=”Publish”> <script> var publishButton = document.getElementById(‘publish’); var checkPublishStatus = setInterval(function() { … Read more

Second featured image only shows in metabox preview after saving a post in the wordpress editor

The issue you’re experiencing, where the image preview in the meta box doesn’t update immediately when you change the second featured image, is likely due to the way the image preview is being handled in your jQuery code. To resolve this, you need to ensure that the image preview updates in real-time as soon as … Read more

Why does WordPress connect to site URL through internet in order to load pages

WordPress’s behavior in this scenario is related to how it handles URL resolution and DNS lookup. WordPress relies on the site URL specified in its configuration to construct internal links and route requests. When you access your WordPress site at https://mysite.example.com, WordPress will generate links based on this URL. In your case, you have configured … Read more

Cookie question

You can set the cookies on the two different pages by modifying your code to include the logic for setting the cookies when a user clicks on one of the options. Here’s the updated code: function my_page_template_redirect() { if ( isset( $_COOKIE[“landvanbartje_cookie”] ) ) { if( $_COOKIE[“landvanbartje_cookie”] == “buiten_seizoen” ) { wp_redirect( ‘/omgeving-rust-ruimte/’ ); exit; … Read more

How to disable the autozoom on mouseover for the product image in Storefront theme of WooCommerce?

Try this, I am not able to test it myself but I do remember using it or something like it in the past: jQuery(document).ready(function($) { // Disable zoom on product images $(‘.woocommerce-product-gallery’).trigger(‘zoom.destroy’); }); You can try this in your functions.php file remove_image_zoom_support() { remove_theme_support( ‘wc-product-gallery-zoom’ ); } add_action( ‘wp’, ‘remove_image_zoom_support’ ); Or, try this css … Read more