I recently deleted a contact form plugin (HubSpot All-In-One Marketing) on a site and the contact forms stopped working. Curiously, the forms work when the plugin is installed and INACTIVE, but they do NOT work when the inactive plugin is DELETED. This means that the plugin being present is affecting the site even when it is inactive. How is this possible? How can a contact form work when a plugin is present and inactive, but not when the plugin is …
Script Widget bug in WordPress. The embed widget from Funda was working before, clueless why it suddenly stopped working. In Public view, it's not working. Preview mode while logged in to WordPress shows the correct page. Actually, the same embedded script from FUNDA is working on this page https://www.homecrew.nl/rent-out/. But the issue is with this page. The script isn’t working on this page https://www.homecrew.nl/reviews-recensies-beoordelingen-klanten-engels/. The Editor & method of placing the script is the same. I cleared the cache etc. …
I have the following script added to functions.php in my child theme: function getlatestfile() { $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('wp-content/uploads/cams/')); foreach ($iterator as $file) { if ($file->isDir()) continue; $path = $file->getPathname(); } return "<img src='https://mysite.url/" . $path . "' />"; } // register shortcode add_shortcode('getfieldimage', 'getlatestfile'); I can save the code, insert the shortcode [getfieldimage] on the page, and the page indeed displays the latest image. No complains. But when trying to edit again the page containing the shortcode, WP …
I want to add a product programmatically using a wordpress plugin but programmatically as entering it manually is a hassle. I have a little bit of programming experience. I found this: What is your best practice to execute one-time scripts? The only issue that I'm having is how do I call functions from a plugin in this script? I guess more specifically, what is the base path of plugin .php files that I would pass in to include() ? An …
Ok, I've literally copy-pasted different enqueueing code from about 5 different sources (Including wordpress), and not a single one works. Here's the code I'm using in functions.php: <?php function my_theme_scripts() { wp_register_script( 'main', get_stylesheet_directory_uri() . '/js/main.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script('main'); } add_action( 'wp_enqueue_scripts', 'my_theme_scripts' ); ?> and it literally does nothing. No scripts added into my HTML. nothing. This is my first time using wordpress, and nobody has explained the functions file to me completely right, but …
This is my entire code and it is working perfectly in my local system xampp but not working on server. function taqyeem_dequeue_scrips() { if(basename($_SERVER['REQUEST_URI'])=='my_page' || basename($_SERVER['REQUEST_URI'])=='') { wp_dequeue_style( 'taqyeem-style' ); wp_dequeue_script( 'taqyeem-main' ); wp_deregister_script( 'comment-reply' ); } } add_action( 'init', 'taqyeem_dequeue_scrips' ); function dequeue_scrips() { if(basename($_SERVER['REQUEST_URI'])=='my_page') { //css wp_dequeue_style( 'taxonomy-image-plugin-public' ); wp_dequeue_style( 'job-alerts-frontend' ); wp_dequeue_style('validate-engine-css'); wp_dequeue_style('cp-shortcode'); wp_dequeue_style('wsl-widget'); wp_dequeue_style('wp-job-manager-applications-frontend'); wp_dequeue_style('wp-job-manager-bookmarks-frontend'); wp_dequeue_style('wp-job-manager-resume-frontend'); wp_dequeue_style('wp-job-manager-frontend'); wp_dequeue_style('cp-widgets-css'); wp_dequeue_style('responsive-css'); wp_dequeue_style('owl-css'); wp_dequeue_style('svg-css'); wp_dequeue_style('cp-burgermenucss'); wp_dequeue_style('law-bx-slider-css'); wp_dequeue_style('prettyPhoto'); wp_dequeue_style('cp-bootstrap'); wp_dequeue_style('cp-wp-commerce'); wp_dequeue_style('cp-bx-slider'); wp_dequeue_style('googleFonts'); wp_dequeue_style('googleFonts-heading'); wp_dequeue_style('menu-googleFonts-heading'); wp_dequeue_style('wppb_stylesheet'); wp_dequeue_style('A2A_SHARE_SAVE'); //Script wp_dequeue_script( 'html5shiv' ); …
I have this html <a href="#1647278006925-e8321147-313b" data-vc-accordion="" data-vc-container=".vc_tta-container"><span class="vc_tta-title-text">LISTEN</span></a> that is printed in my page and opens an accordion with an iframe in it. The iframe: <iframe id="myiFrame" class="stop-lazy" data-src="https://some.iframe" frameborder="0" allowtransparency="true" style="width: 100%;min-height: 150px;"></iframe> I am trying to create a jquery code that will load the iframe only when the user click on the link. So i have tried to set the below script in the footer.php: <script> $(".vc_tta-title-text").click(function(){ var iframe = $("#myiFrame"); iframe.attr("src", iframe.data("src")); }); </script> but it …
I have created a new page on my WordPress site to test the paypal payment flow. I have subscription based products. Attached code is for the paypal subscription button code. <div id="paypal-button-container-P-91F08612M1573283BMIUWMOA"></div> <script src="https://www.paypal.com/sdk/js?client-id=AfGWAPJxdGbCj7b51a2mpoZQYI5y63txxxxxxxxIe1UDh2Vxcr05AFJxxxxNSCNDf8y-xopaJ6&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script> <script> paypal.Buttons({ style: { shape: 'rect', color: 'gold', layout: 'vertical', label: 'subscribe' }, createSubscription: function(data, actions) { return actions.subscription.create({ /* Creates the subscription */ plan_id: 'P-91xxxxxxxxxxxxxxx' }); }, onApprove: function(data, actions) { alert(data.subscriptionID); // You can add optional success message for the subscriber here } …
I know this question has been answered before, but it's not exactly the info I am looking for. Right now I am developing a chatbot for a client. I am kind of new to web development, but especially to wordpress (this is what the client is using). The chatbot is added to the pages using the Insert Headers and Footers plugin from wordpress. I add it to the header. But I guess it would also work in the body. Given …
I want to add an extra table on my WordPress database and I intend to query it with a custom script that will be embedded to WordPress. I'm worrying if this is a safe way to do it, or I should go with the option of adding an entirely new database, not a table on WordPress, as future updates of WordPress system might wipe my custom table? Any experience with such a scenario. Is this a valid risk/worry, or I …
I'm developing a Wordpress custom theme using the child-theme of Understrap. I'm adding my custom jQuery to child-theme > src > js > custom-javascript.js, and the file is already commented with "// Add your custom JS here." https://github.com/understrap/understrap-child/blob/main/src/js/custom-javascript.js I did this as instructed from the Understrap Documentation: "Add your own JS to /src/js/custom-javascript.js to have them bundled into /js/child-theme.js." https://docs.understrap.com/#/understrap-child/npm I've run the script in the console, and it works as intended, so the error is not with my script. …
I write a basic plugin with custom css/js. I use wp_enqueue_script for my custom script and use hook 'init' to register script in front-end page. But wordpress load this javascript file two times with different version. ( See in image ) And I don't know why. I load this script one time and load it in one point of my code. I have tried clean cache wordpress, cache browser, but nothing do. My site is esposte online : https://node.alfonsosomma.it/2022/02/04/articolo-prova/ I …
I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts: function my_detected_scripts() { global $wp_scripts; foreach( $wp_scripts->queue as $handle ) : echo $handle . ' <br /> '; endforeach; } Then: echo my_detected_scripts() How can get the handles of all front-end enqueued scripts only? Thanks in advance!
We added an external script in the body tag of our (dev) website https://zonnebeke.reclamebureau-simplify.be/zonnebeke2022/. However, when checking the console, I see the error message: Refused to execute as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type Any idea if this has to do with Wordpress, or another setting of our website, or how we can solve this issue? Thanks.
I am building a plugin that does many things, one of them being adding a Gutenberg custom block. I am wondering how to structure this. Can I use @wordpress/scripts to bundle the JavaScript or TypeScript that is NOT part of the custom Gutenberg block? And if yes, can you explain how? Or should I just separate this into two plugins? (I'd rather not)
I'm creating a plugin and I want to get the list of all scripts and CSS used by other plugins. This is my function: function crunchify_print_scripts_styles() { $result = []; $result['scripts'] = []; $result['styles'] = []; // Print all loaded Scripts global $wp_scripts; foreach( $wp_scripts->queue as $script ) : $result['scripts'][] = $wp_scripts->registered[$script]->src . ";"; endforeach; // Print all loaded Styles (CSS) global $wp_styles; foreach( $wp_styles->queue as $style ) : $result['styles'][] = $wp_styles->registered[$style]->src . ";"; endforeach; return $result; } add_action( 'wp_enqueue_scripts', …
I use Cloudflare Rocket Loader to speed up Javascript on my site. The problem is, it loads certain scripts that need jQuery before loading jQuery itself making them not working correctly. As soon as it is possible to disable Rocket Loader for specific script adding data-cfasync="false" to the <script src=""> I would like to know how can I add it to jQuery scripts as Wordpress doesn't simply load the jQuery via the script tag I guess. At the moment my …
All of a sudden all the css on the wp-admin page of a Wordpress Site that I'm providing some maintenance for dropped out. It really came out of nowhere. I'm not sure what caused it. I took some pics of errors that appeared in the console. Here is a pic of the source code for that first error "wp-admin:53:1" The error is on a script tag so I'm assuming it's just not able to find something that it's importing... Idk... …