WordPress

  • Extending Woocommerce Registration Fields

    As like WordPress, there’s two Woocommerce Registration Fields – email & password, and sometimes just the email only. Now, we will add two more fields there – first name & last name, and generate username from first name, last name…

  • Categories, Tags, Terms Custom Order

    WordPress doesn’t allow to retrieve categories or terms order by id. You have probably seen, while doing a post query ( get_post(), WP_Query() ), if we set post__in argument with an array of post id, the query exactly order the…

  • Live Composer – Front-End Drag-Drop Content Creator WordPress Plugin

    Visual composer made it far easy for people who do not have programming knowledge. Even having programming knowledge, people prefer to use Visual Composer to save time, and make the task easy and consistence. On 18 January 14, a new…

  • Using Checkbox for post tag & non hierarchical taxonomies

    The article describe how to make term (ex: post tag) metabox a checkbox list rather than name input. So terms can be selected as like categories. This does work with Custom Taxonomies too. Non hierarchical taxonomy are those who doesn’t…

  • WordPress Plugin page without showing in admin menu

    To exclude Your Plugin page link from wp-admin menu, simply register a menu leaving the parent menu slug empty or null. Template and load plugin page hook will be still available

  • WordPress Multiple Post Type Loop & Pagination by Shortcode

    This article describe how to create multiple post loop with pagination by shortcode. You might have already know how to create post list with shortcode, here i am extending that with multiple occurrence and pagination. Multiple Post Type Loop &…

  • WordPress Page Custom Query Variable & Parameter

    Extend WordPress Page with Custom Query Variable. Set or get parameter variables using set_query_var & get_query_var. Use parse_request to filter values

  • Social Share Count for WordPress Post

    WordPress Post Social Share Count – by this i mean how many times the post has been share on social networks such as facebook, twitter, google plus, linkedin and few others. The social count comes up useful sometime for showing…

  • Using Stylesheet, JavaScript Scripts for WordPress Widget

    CSS and Javascript Scripts for Widgets can be used based on widget availability. If you have created a custom widget and need to load stylesheet only if it active on front end, you will have to use is_active_widget WordPress function…

  • WordPress SEO Plugins List

    Checkout the best WordPress SEO plugins that can boost your WordPress site presence at it’s maximum level. Both Free & Commercial Plugins are available.

  • Extending WordPress Registration Fields

    WordPress has two registration fields for the default form, email and username. If you need more information, you could use plugins ofcourse. But for some simple fields such as a Name or Full name or Age of the registrants, you…

  • Facebook Page Like Count WordPress Shortcode

    The easiest way to show your facebook page like count is to use the facebook like button. As it comes with a limited module and not show only the number count rather than adding a like or recommend text, somewhere…

  • Display Future Posts WordPress

    WordPress doesn’t include future posts on Blog, Archive, Widget or Single post pages. However that is logical. But yet if someone need to display future posts lists & also display future post on single post page, here is a solution.…

  • add_action – WordPress function to hook on an action

    add_action is an extremely used WordPress function, constructed using of PHP’s native function call_user_func_array, widely used in WP core, plugin & theme. In other sense, add_action is similar method to JavaScript’s on event binding mechanism – on(‘event’)

  • Create WordPress Plugin

    Creating a WordPress Plugin is very simple if you have a basic PHP knowledge. A single PHP file can be used as a WordPress Plugin having some structured information. Lets try creating your first WordPress Plugin.

  • WooCommerce Custom Pricing Method for Products

    WooCommerce have two pricing method for Products – Regular and Sale price. These methods are used regardless of registered users or visitors. Now, what if you wanna add pricing for some specific user role ? there is plugin for that…

  • WP Admin custom post list page blank

    When i was working with wp e-commerce plugin, i saw product list page is blank. After taking a deeper look i found, WordPress Post List Table Classs loads all the posts at once while post type is hierarchical and there…

  • Integrate Registration with Facebook Account on WordPress Site

    If you want to build Registration with Facebook Account without using any plugin, this article will help you to do so. All of the codes can be placed on your themes functions.php file, or any file included through that file,…

  • Wp Ajax – WordPress Hook to Handle Ajax Request

    Basic usage of wp_ajax and wp_ajax_nopriv on your WordPress. Add ajaxurl variable on any of your front pages.

  • Remove Featured image meta box from WordPress Admin

    In WordPress, the remove_meta_box is used to remove metabox from post, page, link or any custom page form in admin section. However, remove_meta_box function doesn’t work for featured image box (postimagediv). After digging the core function, found a solution here.…


Freelance

Code Snippets

  • jQuery On Change Radio value

    See how u can use radio button action with jquery. Get, set or compare selected radio button value.

  • How to check & increase PHP memory usage

    To check PHP menory usage function display_used_memory() { $m = memory_get_usage(); $d = 1024 * 1024; echo number_format( $m / $d, 2 ).”MB”; } put display_used_memory() as the end of your PHP file. To increase PHP memory usage if( !ini_get(…

  • PHP codes for Connecting multiple MySQL Databases at once

    Multiple calls can be made using mysql_connect() and mysql_select_db(). $dbh1 = mysql_connect($hostname1, $username1, $password1); $dbh2 = mysql_connect($hostname2, $username2, $password2); mysql_select_db(‘database1′, $dbh1); mysql_select_db(‘database2′, $dbh2); If both connection parameter has same values, then you need to pass true for the fourth parameter…

  • Display Twitter Bootstrap Dropdown on hover by CSS or jQuery

    Want to display Twitter Bootstrap Dropdown on hover ? Here’s are some solutions. It can be done using CSS, jQuery Code or a jQuery Plugin

  • JavaScript Regular Expression

    JavaScript Regular Expressions are quite same as PHP Regular Expressions. Syntax var check = /pattern/modifiers; pattern specifies the pattern of an expression modifiers specify if a search should be global, case-sensitive, etc. Modifiers Modifiers are used to perform case-insensitive and…

  • JavaScript debugging function similar to PHP var_dump / print_r

    Debug JavaScript array or object as like PHP’s print_r or var_dump function. create your own javascript debugging function

  • Get Mysql Table field names array

    function mysql_table_field_names( $table_name ) { $total_fields = (int) mysql_num_fields( mysql_query( “SELECT * FROM $table_name”)); $names = array(); for ( $i = 0; $i < $total_fields; $i++ ){ $names[] = mysql_field_name( mysql_query( “SELECT * FROM $table_name”), $i ); } return $names;…

  • Hex color validation with regex

    Php code for validating hex color

  • PHP Regular Expression Character Definition

    To user PHP regular expression with preg_match, preg_replace or other preg_ function, one should understand the characters that are used. Below listed all of the characters that are used in regex. List of Regular Expression Characters ^ // Match the…