How WordPress Plugin Auto Update Works

WordPress upgrades a plugin when an admin click on update-now button or upload a new zip file. Besides that, a WordPress plugin can also be updated automatically if an admin enables auto-update for that plugin. Here’s how plugin auto update works. WP_Version_Check When we click on Enable auto-updates for a plugin, WordPress store the plugin’s […]

Extend Woocommerce Registration form fields

As like WordPress, Woocommerce Registration form fields are the same – User email & Password. Additionally, WC sometime just use the Email field only. This article describes how you can add additional registration form fields to the WC’s registration form. In this post, we will add two more fields there – First name & Last name, […]

Categories, Tags, Terms Custom Order

WordPress doesn’t allow to fetching categories or terms order by their 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 results by given ids order. But, when using get_terms(), if we pass include argument, […]

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 & Pagination by Shortcode – Code For pagination, We are using a custom query argument pg […]

WordPress Page Add Custom Endpoint

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

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 right after parent::__construct method has been called. Now for using Scripts for Widget outside of […]

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 might not want to use a plugin. Here is how you can do that. Add […]

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 it becomes useless. However they have API to server you the count in number, if […]

Displaying WordPress Future Posts

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. Shortcode to display the list of future posts function future_postlist_shortcode($atts) { extract( shortcode_atts( array( ‘post_type’ […]

add_action – WordPress function to hook on events

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 ofcourse. But how can you make it without using any plugin ? Well, we have […]

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 has been no orderby argument. You can check the reference on wp-admin/includes/post.php file on function […]

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, or within an active plugin. Step 1: Register Facebook Application Register a facebook application and […]

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. I just wanted to remove the ‘postimagediv’ meta box from the post edit form for […]

Login to WordPress Admin Using Php cURL

You might have a WordPress site which generates a file/information daily and you want to grab it without logging to your site. It can be done using cURL. So you don’t have to loggin and view the page anymore. Just use this script on your local server and run the script. It will get you […]

Schedule Additional Cron Job with cron_schedules WordPress hook

For Cron job, WordPress have three schedule time hourly, twicedaily and daily to add your event. All of them run on defined interval. Hourly runs in every hour, twicedaily runs in each 12 hours and daily runs in every 24 hours. To add a new schedule time, cron_schedules() filter is used. Below code will add […]

W4 Post List Examples

All of the lists shown below are created with W4 Post List plugin. Template created with shortcodes, HTML and CSS. Examples 1: Posts List List of posts. Showing post title, post date and post categories. Pagination is used with ajax call. Examples 2: Photos Grid List of images. Pagination is used with ajax call. Examples […]