Category Archive for "Code snippets"

WordPress- disable plugin update

Jun 22 2015

Add this code in your plugin root file. It will prevent plugin updates notifications.   add_filter(‘site_transient_update_plugins’, ‘remove_update_notification’); function remove_update_notification($value) {      unset($value->response[ plugin_basename(__FILE__) ]);      return $value; }   Other…

Woocommerce – Featured Image URL and Gallery images

Nov 28 2014

Get Woocommerce Gallery Images :                     <?php  global $product;                          $attachment_ids = $product->get_gallery_attachment_ids();                         foreach(…

WooCommerce enable Reviews for all products

Feb 03 2014

With WooCommerce, there is an option to enable/disable reviews for each product. Unfortunately, the checkbox doesn’t come checked by default.  This box being checked depends on whether or not you…

Shortcode in a WordPress Template

Oct 01 2013

Shortcodes in WordPress are bits of text you can use in the content area to invoke some kind of function to accomplish certain tasks. You can write your own shortcodes,…

Jquery detect orientation change

Aug 11 2013

Detect a orientation change of portable device with jQuery: function orient() { var mobh1 = jQuery(window).height(); var mobw1 = jQuery(window).width(); if(mobh1 > mobw1) {              pos =…