Create an unique ID number after submit form

in order to do this use AUTO_INCREMENT PRIMARY KEY while you define your table. Your table should be something like this: CREATE TABLE `order` ( `order_id` INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, `user_group_id` INT(11) UNSIGNED NOT NULL, `status` BIT, `meta` VARCHAR ( 255 ), `value` TEXT, `update_time` TIMESTAMP )DEFAULT CHARSET = utf8; remember that you could … Read more

Add HTML before a specific div?

Seems like jQuery is best for this case. Mainly answering for myself in case I’ll need it again in the future: <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> <script> $(document).ready(function(){ $(“#this_comes_before”).insertBefore(“#wc_checkout_add_ons”); }); </script> </head> <body> <div id=”wc_checkout_add_ons”>stuff</div> <div id=”this_comes_before”>something</div> </body> Edit for future me: Use this instead you lazy asshole… add_action( ‘woocommerce_checkout_after_customer_details’, ‘test99’ ); function test99() { echo “your … Read more

Open all external links in new window – need help with the code

Way to complicated to do this with php in WordPress, I’d advice on doing this on the frontend with a bit of jquery magic. I wrote a tiny jQuery plugin that opens all external links (all links with another domain/host name than the current site) in a new window. Check out the plugin: https://www.npmjs.com/package/jquery.jold.external-hrefs To … Read more

WordPress Memory limit not increasing

Try to create .user.ini file in root and put below code upload_max_filesize = 500M post_max_size = 256M memory_limit = 500M max_execution_time = 300 max_input_vars = 500M Try and let me know if any query. Hope it will help!

How to NOT override inline css rules

Please see this post about including styles and scripts correctly. As far as I can see, you are just throwing in the style.css, giving WordPress not the opportunity to decide, which stylesheet comes when. In order to do that, you need to register your style first, then WordPress can decide according to your priority, where … Read more

Load my plugin before cache

By default WordPress first checks for any must-use plugins (plugins in the optional mu-plugins folder) and loads those. So the first plugins loaded will be those located in /wp-content/mu-plugins folder Then, if you’re running a multisite installation, it checks for plugins that are network-activated and loads those. Then it checks for all other active plugins … Read more