comment-reply.js disables any other form javascript

I found the cuplrit and has nothing to do with comment-reply.js. I was targeting my javascript based on which template and of course the javascript wasn’t loading. if( $(“body”).hasClass(“page”) ){ … Needed to add this: if( $(“body”).hasClass(“page”) || $(“body”).hasClass(“single”) ){ …

Create new product with woocommerce REST API with javascript (clientside)?

If you’re using SSL (HTTPS URL) you don’t need to use oauth1.0 with oauth signature and everything. All you need to do is pass in the consumer_key and consumer_secret in the url https://localhost/wpShop/wc-api/v2/products?consumer_key=ck_1111111111122123&consumer_secret=cs_232332322233232 That’s it! However, if your URL is NOT SSL, then you have to go to the trouble of creating an HMAC-SHA1 keys … Read more

Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?

Maybe It’s the Appropriate Answer for You! Accordingly to this question the more reasonable answer is to use wp_send_json() with (if only necessary) the wp_send_json_success() and wp_send_json_error() functions. They’ll return an JSON Object back to the AJAX Request and it will automatically die() for you. It will look something like this: add_action( ‘wp_ajax_origin’, ‘create_an_ajax_request_origin_form’ ); … Read more

Search and Replace Script Loader in Head Only Works in Footer

Can you try this, it was what I tried to explain in my comment. Again, this is just a guess. function js_async_attr($tag){ // Add async to all remaining scripts return str_replace( ‘ src’, ‘ async=”async” src’, $tag ); } add_filter( ‘script_loader_tag’, ‘js_async_attr’); function remove_js_async_head(){ // function to add async to all scripts remove_filter( ‘script_loader_tag’, ‘js_async_attr’); … Read more

Loading scripts only if a particular shortcode or widget is present

You can use the function is_active_widget . E.g.: function check_widget() { if( is_active_widget( ”, ”, ‘search’ ) ) { // check if search widget is used wp_enqueue_script(‘my-script’); } } add_action( ‘init’, ‘check_widget’ ); To load the script in the page where the widget is loaded only, you will have to add the is_active_widget() code, in … Read more

How to toggle custom WP archive list

I know nothing about the theme or plugins you are using. Since your theme isn’t responsive you could get away with the down and dirty approach if you can edit CSS files: /wp-content/themes/mytable/style.css line 262 .content-bar { border-right: none; width: 890px; } /wp-content/themes/mytable/style.css line 181 .right-sidebar { display: none; } Or override by adding your … Read more