Gulp tutorial for beginners

In a sentence, Gulp is a task runner. Gulp makes our life easier. In a development workflow, we need to do some tasks frequently and gulp can do some tasks automatically. Don’t think gulp is a replacement of grunt, but it is being improved very very fast. Gulp is a task/build runner for development. It allows you to do a lot of stuff within your development workflow. You can compile sass files, uglify and compress js files and much more. The kicker for gulp is that its a streaming build system which doesn’t write temp files. In this article, I […]

Continue Reading

You may also like

How to use SSL in localhost

There are lots of stuffs we need to test with SSL. There are some SSL providers that provide free SSL we can use those in our site. Among free SSL providers, I prefer to use CloudFlare, it’s very easy to use and nothing to setup though it needs ~24 hours to activate. Also, developers from countries where we don’t have super high speed internet, we are used to work in locally hosted site. So, usually we can’t use SSL in local site – in other words most of the developers doesn’t know. But it’s possible, and even it’s not complex […]

Continue Reading

You may also like

How to apply coupon automatically on WPMU membership2 checkout

Membership 2 is an awesome plugin to sell your content. That being said, you can charge your members to see your site content. If you want to give discount, you can use Coupon addon. You have to enable from Membership 2 > Addons and then you can create coupons and share with your users. Today I will show you a trick to share coupon embedded with URL. You can share your URl like domain.com/?coupon=XXXX and the XXXX coupon will be automatically applied on checkout.

Continue Reading

You may also like

Assign and withdraw role on an user based on WPMU Membership2

WPMU Membership2 plugin has an addon that you can use to assign extra capabilities to an user when he joins in a membership, and when the user left the membership the capabilities are withdrawn. But, the problem is, even it says “Assign role”, it doesn’t assign role to that users but just assign the capabilities of that role. So, if you need members of certain role, you won’t get those members in the member list. Even, if you have other plugin that makes some operation based on role, won’t work here. Let’s find a solution. The following snippet will allow […]

Continue Reading

You may also like

Assign a membership to a registered member automatically – Membership 2 (WPMU)

WPMU DEV has released the new revamped version for membership plugin, called Membership 2. The layout and interface is awesome of the plugin and I am personally impressed. There is a new type of membership introduced in the plugin – Default Membership. This membership will work for the user who are just registered but didn’t choose any membership to join. But what if you want to assign a regular membership to that user? Here is a simple code snippet that will help you to do this job: This file contains bidirectional Unicode text that may be interpreted or compiled differently […]

Continue Reading

You may also like

How to add an user into a BuddyPress group automatically when he joins in a WPMU membership

This is an useful snippet that will add your newly registered (via WPMU DEV Membership 2) member to corresponding BuddyPress group. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters <?php add_action( 'ms_model_relationship_create_ms_relationship_before', 'ms_controller_member_assign_memberships_done_cb', 99, 4 ); function ms_controller_member_assign_memberships_done_cb( $membership_id, $user_id, $gateway_id, $move_from_id ) { // Create an array with membership IDs and group IDs like: /*$array = array( 'membership_id' => 'group_id', 'membership_id' => 'group_id', 'membership_id' => 'group_id' );*/ $config […]

Continue Reading

You may also like

How to use custom post type archive as front page

We can easily set any page as front page from Settings > Reading. It can be any static page. But what if we want to set an archive or CPT archive page as front page? There are many ways to do so. We can create a custom page template, and write our code to get the posts for the post type (will look like an archive). Then create a wordpress page using that page template and select that page as front page from Settings > Reading. This is a little complex if you are not a developer. Or even if […]

Continue Reading

You may also like

Defer parsing of javascript to improve performance in wordpress

Nothing for introduction, hehe! A very small snippet which will help you to defer parsing all javascript files except jquery in wordpress. Here is the code: This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters <?php function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; return "$url' defer "; } add_filter( 'clean_url', 'defer_parsing_of_js', […]

Continue Reading

You may also like

Why you shouldn’t use one click installer to install wordpress

Yes, you will fall at the mid-ocean, trust me! Well, most of the bloggers just maintain a simple blog so usually they don’t need to worry. They just need to keep a regular backup. But if you are planning to run a business site in wordpress and if that site is your everything, never ever use one click installer to install wordpress! You’d be better off installing it manually which may take you a few minutes longer to install. Here you can get an idea about manually installing wordpress: codex.wordpress.org/Installing_WordPress www.siteground.com/tutorials/wordpress/wordpress-installation.htm If you want to install manually, download wordpress from […]

Continue Reading

You may also like

How to convert hexadecimal color value to RGB value in php

Most of the CMS provides a color picker in admin panel to user to choose a color. And almost all of the color pickers return the color code as hexadecimal mode, e.g. #4EE4D3. So, you can just get the value and set the color in css. For example: [php] body{ background: } [/php] This is a very good practice. Problem occurs if you want to put a opacity option to the user. You can set background opacity with hexadecimal color value. You must use RGBA filter, so RGB color mode as well. Like: [css] body{ background: rgba(233, 122, 234, 0.7); […]

Continue Reading

You may also like