Easily display member cards with WPMU DEV Membership

Here’s a simple shortcode snippet to let you easily add a membership card for your site’s members when using WPMU DEV’s Membership plugin. This was requested in the WPMU DEV forums, where we love to help members out with simple and useful custom snippets. WPMU DEV Forum topic: Display Membership Data Print/Mobile The snippet adds a [mem_card] shortcode that will then show some member details. 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 […]

Continue Reading

You may also like

How to add multiple custom excerpt length in wordpress

In archive pages, we use the_excerpt() function to show excerpt of each posts. Be default, wordpress uses 55 words as excerpt if you don’t enter anything in Excerpt meta field. Now, if you want to change the length of excerpt, there is a filter available for that. excerpt_length is the filter that you can use to customize the excerpt length, just use it following way: [php] function new_excerpt_length($length) { return 20; } add_filter(‘excerpt_length’, ‘new_excerpt_length’); [/php] You can change 20 to some other integer. But what if you need to use multiple length of excerpt in different archive pages? We, in […]

Continue Reading

You may also like

WordPress: How to load all styles and scripts in footer

We want to load styles and scripts in footer in wordpress to load it faster. In fact the best practice is to load styles in head and the scripts in footer. We can use some minify plugins to minify all styles and/or scripts. But sometimes it creates issues, in most cases in SSL enabled pages minified styles do no work. Also, we don’t have control in third party plugins, some plugins pushes scripts in head and some pushes in footer. So, it’s not possible to go through all plugins and make changes. I have a little code snippet that will […]

Continue Reading

You may also like

How to enable php mail() in your ubuntu

In my last post I showed you how you can set up an ubuntu server for apache, php, mysql, phpmyadmin and wordpress multiste. Below is the link if you want to take a look: How to setup a VPS (Ubuntu) for WordPress hosting – A to Z tutorial Today, we will learn how we can enable email in that server, so that we can use php mail() to send mail from our system. Today I won’t go in that detail but just to set a simple mail server. The simplest way to enable mail in your ubuntu is to run […]

Continue Reading

You may also like

How to hide a plugin for non-admin users in wordpress

Today I will show how you can hide a plugin from the users that are non-admin. If you use a multisite, you can control a lots of stuffs with Pro Sites plugin. But what if you don’t want to use Pro Sites? This simple scripts will do the job for you. [php] function custom_plugins( $plugins ){ if ( !is_super_admin() ) { // Add comma separated paths of plugins that you want to hide $hide_plugins = array(‘pluginFolder/pluginFile.php’, ‘pluginFile.php’); foreach ($hide_plugins as $hide_plugin) { unset($plugins[$hide_plugin]); } } return $plugins; } add_filter(‘all_plugins’, ‘custom_plugins’); [/php] You can add those codes in your functions.php in […]

Continue Reading

You may also like

How to redirect user to his primary blog on login in a multisite

Some web admins don’t like to to redirect the user to network site dashboard upon login. So, they want to redirect the user to the primary blog’s dashboard. Well, it’s fair enough. So, if an user 5 subsites, and when he will login, he will be redirected to his primary blog’s dashboard. He will still be able to access all of his sites from My Sites link at the top left of admin bar. He is also able to change his primary blog. So the following script will do the job: [php] function go_to_primary_blog($redirect_to, $request, $user){ $user_info = get_userdata($user->ID); return […]

Continue Reading

You may also like

How to setup a VPS (Ubuntu) for WordPress hosting – A to Z tutorial

VPS is being more popular day by day. Personally I prefer to use DigitalOcean, they are cheap and their support is awesome. They also have tons of tutorial guides, chat community. Also they answer your questions very quickly in their support forum. Let’s dive into the main point. When you will have a VPS droplet, you will get an IP, login username, password that you can use to login in your VPS via command line. There are several tools like Putty in windows, but I love to work in command line in Linux or Mac OS. Let’s assume the IP […]

Continue Reading

You may also like

WordPress Meet The Team Plugin – best ever

Meet the Team is a WordPress plugin that allows you to easily create and manage teams. You can display single teams as multiple columns, you can also showcase all teams as a filterable isotope gallery, easy social links management included. The purpose of this plugin is to allow you to create a “Meet the Team/Partners” page for a website. This plugin makes it easy to create a Team Page to showcase your most important assets. [purchase_link id=”633″ text=”Add to Cart” style=”button” color=”green”] It’s very cheap and easy to use. You can check the “demo” and “how to use” in following […]

Continue Reading

You may also like

HTTP Error when uploading images in WordPress – no thumbnail

Did you ever see HTTP Error when uploading an image in wordpress? Most of the times the images are uploaded but no thumbnail is created. And sometimes the images are not even uploaded. We are going to discuss about this right now! There could be several issues that cause this error. First of all, we can assume that you don’t have enough memory for the script to be executed. So, try adding something like the following in your wp-config.php file: [php] define(‘WP_MEMORY_LIMIT’, ’64MB’); [/php] In stead of 64MB you may need more, though you can’t exceed the limit that your […]

Continue Reading

You may also like

How to get start date of a week in JavaScript

This is little tricky to get the start date or/and end date of a week. Also, there is no standard day that should be a REAL start day in a week. In my example, I assume that the start day is Monday. Also, I will show you how you can adjust it to fit your needs. So, you can make it as Saturday or Sunday or whatever. In my example, suppose I want to make a title like “Accepting Bookings For the Week of START_DATE to END_DATE”. So, within this week, it should be same. But in next week, it […]

Continue Reading

You may also like