How to use information from the database in the front-end?
How to use information from the database in the front-end?
How to use information from the database in the front-end?
Ajax show custom post data form & script
iFrame onLoad in custom Gutenberg block
There’s two approaches you may want to use here, depending on the notification behavior desired: To notify each user any time there are new notifications: You need to make sure your sql query returns the notifications in a sorted order (preferably with descending data timestamps) and includes a unique identifier/primary ID [PID] for the rows … Read more
Spans in gutenberg
Ad1. Just after make minification, do some tests with development tools (F12 in FF) There is a console where you will see all errors, warning etc. If something went wrong, you’ll see it https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console Ad2. Hard to say because every case is different but sometimes it’s matter. Which plugin do you use for that? For … Read more
Just change wp_localize_script( ‘load_product_info’ , ‘products’ , $gg_products); with (EDITED ->wp_localize_script() accepts an array as 3rd par.) wp_localize_script( ‘load_product_info’ , ‘products’ , array(‘current_products’=>json_encode($gg_products ) ) ); transforming the php object into a json string and building an array . Then in the js file convert the string into a js object with JSON.parse function load_product_info() … Read more
Figured it out! First I passed what Iceable suggested and also added moment script above, like so wp_register_script(‘moment’, “https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js”); wp_register_script( ‘fullcalendar’, “https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.js”, array( ‘jquery’ ), null, true); and then I edited JS like so jQuery(function ($) { $(‘#calendar’).fullCalendar({ }) }); And it showed up!
Normally on WordPress you use Your Theme Functions.php to put that code. But in this case we are talking about a WordPress with WooCommerce (I’d think), so if you add custom code to your theme as I told you normally is the case, it will be gone if you change your theme, for that reason … Read more
You idea is equivalent to DDOSing your site, and the difference between the methods is only how fast you will bring the site down. WordPress AJAX handling is expensive, and should be limited to user initiated actions. Your second method will be more resilient but you are still going to be wasting server resources as … Read more