June 23, 2015

How to apply a custom header image for each page in WordPress?

How to apply a custom header image for each page in WordPress with respect to the navigation menu bar? Here is the function: function get_parent_menu_id($id, $arr){ if($arr[$id]==0) return $id; else return get_parent_menu_id($arr[$id], $arr); } $arr = array(); $arr_obj = array(); $page_id = get_the_ID(); $menu_items = wp_get_nav_menu_items(‘Menu Main’); if(!empty($menu_items)){ foreach($menu_items as $items){ $parent = $items->menu_item_parent; $arr[$items->ID] […]

PHP function to check that you are main page?

define(‘LIVE’, (!in_array($_SERVER[‘HTTP_HOST’], array(‘localhost’, ‘wp-mechanic’)))); if(!function_exists(‘is_main’)){ function is_main(){ $uri = $_SERVER[‘REQUEST_URI’]; $arr = explode(‘/’, $uri); $arr = array_filter($arr, ‘strlen’); return ((!LIVE && (count($arr)==1)) || (LIVE && empty($arr)));//empty($uri) } }

June 16, 2015

Uploadify is not working in wp-admin as expected?

Solution is as follows: Go to initial state and don’t use any uploadify for now Try with default jquery, everything working fine Then use your plugin file as “enqueue” instead of linking files directly Enqueue one by one the js files Keep checking the conflicts Finally you will get it work, you are just missing […]

May 17, 2015

jQuery contains vs. JavaScript indexOf to filter results

jQuery contains vs. JavaScript indexOf to filter results $(‘#sess_input’).on(‘keyup’, function(){ var filter = $(this).val(); $(“#sess_table .sess_rows”).each(function() { var found = $(this).text().toLowerCase().indexOf(filter); if(found

May 14, 2015

is_woocommerce function to cover all important woocommerce pages

is_woocommerce function to cover all important woocommerce pages function is_wc(){ return ( is_woocommerce() || is_shop() || is_product() || is_cart() || is_checkout() || is_account_page() ); }

May 13, 2015

php function to get first letter of each word and make a unique key

A PHP helper function to arrange and rearrange randomly generate php array elements.

January 26, 2015

WordPress Plugin – jQuery Post Splitter

jQuery Post Splitter

December 2, 2014

WP eCommerce Wishlist

WP eCommerce Wishlist