Category Archives: Web Development

WordPress print all enqueued scripts and handlers

global $wp_scripts; print ‘<!– ‘; var_dump($wp_scripts); print ‘–>’;   Source :¬†https://wordpress.org/ideas/topic/function-to-display-an-array-of-all-enqueued-scriptsstyles

WooCommerce – Placeholders from labels (bookmark)

Link – http://tarikhamilton.com/blog/2016/03/24/create-placeholders-for-woocommerce-fields-from-the-labels-dry/

403 Forbidden – MAMP Pro

So I was working on a wordpress template requiring frequent Sass builds and synced my installation to local MAMP installation. And like always got the 403 Forbidden error and as usual started searching for the solution and quick fix. I am lazy and this seems to happen every time with me. I ended up on http://www.witheringtree.com/2009/09/403-forbidden-using-mamp/ From there I remembered that there is something similar in the Main window of MAMP. So I am just documenting this here for future use,
  • Opened MAMP
  • Select host to edit
  • Clicked on Extended tab on the right
  • Set “AllowOverride” from “All” to “None”
 

What to do if cPanel CSS and layout goes wonky – check cloudflare first!

On my cloudflare activated domain, the cPanel was appearing in a styleless and imageless manner. On searching for a cause for the same, I ended up going through a number of search results and finally found one which seemed to address my issues. Cloudflare was caching up the CSS for the cPanel in addition to the rest of the domain and hence needed to be bypassed for the cPanel. And then everything was fixed. This error is mentioned by them in their docs, but it doesn’t show up in google results untill unless “cloudlfare” and “cPanel” are searched together. Cloudflare docs – https://support.cloudflare.com/hc/en-us/articles/200063289-My-cPanel-won-t-load-or-keeps-logging-me-out-after-enabling-CloudFlare

Read more

Woocommerce Update broke functionality of Cart

Trying to find the reason for the cart not working, I ended up looking through the logs to find out that $woocommerce->show_messages() was causing a fatal error. Googled a little bit and found the following change $woocommerce->show_messages(); to wc_print_notices(); Made the changes and it worked. This problem might affect people who have custom templates with woocommerce support and woocommerce might crash on update.