Easy Guide to Add Custom Post Status for Blog Posts in WordPress

In this article, we will show you how to easily add custom post status to blog posts in WordPress.

 

What is Post Status in WordPress and Why Do You Need it?

Post status is an editorial tool that tells WordPress the stage of a blog post during editing. For example, posts that are incomplete are saved with the post status labeled ‘Draft’. When you publish an article, the status changes to ‘Published’.

Post status helps WordPress choose how to handle and display blog posts on your website. For example, it will automatically exclude posts labeled draft from your homepage and other publicly viewable areas of your website.

By default, WordPress comes with the following post status that you can use:

  • Draft – An item that is saved but incomplete and not yet published
  • Auto draft – WordPress has an auto-save feature that automatically saves a draft as revision.
  • Pending review – Items that are complete and submitted for review but not yet published.
  • Future – Posts scheduled to be published later.
  • Private – Items marked as private
  • Trash – Items that are trashed
  • Inherit – Child pages that automatically inherit status of their parent page.

Apart from these default post statuses, you can also create your own custom post statuses to improve your editorial workflow. For example, you can add a label ‘Not suitable’ for posts that are complete but not suitable for publication.

Having said that, let’s take a look at how to easily create custom post statuses in WordPress.

Method 1. Create Custom Post Status Using a Plugin

This method is easier and recommended for most users. It allows you to create custom post statuses as well as efficiently manage editorial workflowon your multi-author WordPress blog.

The first thing you need to do is install and activate the Edit Flow plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will add a new menu item labeled ‘Edit Flow’ to your WordPress admin menu. Clicking on it will take you to the plugin’s settings page.

Edit Flow comes with a lot of useful features, and you can turn them On/Off from this screen. Go ahead and click on the ‘Edit Statuses’ button under ‘Custom Statuses’ box to continue.

Edit Flow automatically creates the following custom post statuses:

  • Pitch – Used to pitch new article ideas and this status also becomes the default post status of every new post.
  • Assigned – You can select an author and mark an article as assigned so that the author can work on it.
  • In progress – Writer is working on the post but is not yet available as a readable draft.

You can create your own custom status by providing a name and description in the left column. Once you are done, click on the ‘Add new status’ button to save your changes.

Your custom status will now appear in the right-hand column, so you can edit or delete it at any time.

Next, you need to go to Posts » Add New page to create a new post. On the post edit screen, click on the ‘Edit’ link next to status option under the ‘Publish’ meta box.

This will reveal a drop-down menu showing all post statuses that you can select including the custom post status you just created.

You can also see all articles filed under different post statuses by visiting Posts » All Posts page.

Method 2. Create Custom Post Status Using Code

WordPress has a known bug in the API used to register custom post statuses. It allows you to create custom post status, but you cannot use it in the admin panel. This means that the coding method can get the job done, but it is not as clean, and you will need to change it after it is officially fixed.

However if you still want to do it manually, then you can continue reading.

This method requires you to add code to your WordPress site. If you haven’t done this before, then take a look at our guide on how to copy and paste code in WordPress.

First, you need to add the following code to your theme’s functions.php file or a site-specific plugin.

// Registering custom post status
function wpb_custom_post_status(){
    register_post_status('rejected', array(
        'label'                     => _x( 'Rejected', 'post' ),
        'public'                    => false,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>' ),
    ) );
}
add_action( 'init', 'wpb_custom_post_status' );
 
// Using jQuery to add it to post status dropdown
add_action('admin_footer-post.php', 'wpb_append_post_status_list');
function wpb_append_post_status_list(){
global $post;
$complete = '';
$label = '';
if($post->post_type == 'post'){
if($post->post_status == 'rejected'){
$complete = ' selected="selected"';
$label = '<span id="post-status-display"> Rejected</span>';
}
echo '
<script>
jQuery(document).ready(function($){
$("select#post_status").append("<option value=\"rejected\" '.$complete.'>Rejected</option>");
$(".misc-pub-section label").append("'.$label.'");
});
</script>
';
}
}

Don’t forget to replace all instances of the word rejected with your own custom post status.

This code registers a custom post status and after that, it uses jQuery to add it to the admin panel. You can now edit a WordPress post, and you will be able to see it in the status drop-down menu.

We hope this article helped you add custom post status to blog posts in WordPress. You may also want to see our list of 55+ most wanted WordPress tips, tricks, and hacks.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Easy Guide to Display Popular Posts by Day, Week, and Month in WordPress

In this article, we will show you how to display popular posts by day, week, month, and all time in WordPress.

 

Why Display Popular Posts in WordPress?

When you start a WordPress blog, you don’t have much content, which allows you to manually display selected posts in a sidebar widget.

However as your website grows, you will notice that older articles on your website don’t get much exposure. By showcasing your top content, you allow new users to quickly discover the best articles on your website. This boosts user engagement on your website and increases your page views.

Now the problem is that if you are showing your all time popular articles, then a very limited set of articles get repeated exposure. You can diversify it by displaying popular posts by day, week, or month as well.

Let’s take a look at how to easily display popular posts in WordPress by day, week, month, or all time.

Creating Popular Posts By Day, Week, Month, and All Time Widgets

First, you will need to install and activate the WordPress Popular Posts plugin. For more details, see our step by step guide on how to install a WordPress plugin.

WordPress Popular Posts plugin is the best popular posts plugin for WordPress. It offers tons of options like time range, excerpt, featured images, views count, and more.

Upon activation, you need to head over to Appearance » Widgets page to drag and drop the WordPress Popular Posts widget to any sidebar.

You can name this widget ‘Today’ and under the time range field select last 24 hours. After that you can review other widget options and set them to your liking. Don’t forget to click on the save button to store your widget settings.

Next, you need to add another popular posts widget and name it ‘Week’. In the widget settings, you need to select ‘7 days’ under time range field and then click on the save button.

Repeat the process to add monthly and all time popular posts widgets as well.

Don’t worry about the widget placement at this time because we will adjust them in the next step.

Creating a Tabbed Widget for Popular Posts

In this part of the tutorial, we will create a tabbed widget for our WordPress sidebar. This will allow us to show our popular posts widgets inside a single widget with tabs.

First, you need to install and activate the Ultimate Tabbed Widget plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to Appearance » Widgets page, and you will notice a new widget ready area labeled ‘Default Tabbed Widget Area’.

You will need to move all your popular post widgets into this particular widget area.

Next, you need to locate the ‘Ultimate Tabbed Widgets’ in the available widgets and add it to your website’s sidebar where you want to display popular posts.

In the widget settings, provide a title for your popular posts widget. Under widget area field, you need to select ‘Default tabbed widget area’, and select tabs for template field.

Don’t forget to click on the ‘Save’ button to store your changes.

You can now visit your website to see your popular posts widget showing top articles by day, week, month and all time tabs.

You can rearrange the tab order by simply moving widgets up and down in the ‘Default tabbed widget area’.

We hope this article helped you display popular posts by day, week, month, and all time in WordPress. You may also want to see these actionable tips to drive traffic to your WordPress blog.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

How to Create an Online Marketplace using WordPress

Create an Online Marketplace

In this article, we will show you how to easily create an online marketplace using WordPress.

 

What Do You Need to Start an Online Marketplace using WordPress?

First you need to make sure that you are using the right website platform, and since you’re reading this article, you’re in the right place.

There are two types of WordPress available: WordPress.com vs WordPress.org. One is a limited blog hosting service while the other is known as the self-hosted WordPress which you’ve likely heard tons about. See the full comparison between WordPress.com vs WordPress.org.

We recommend using WordPress.org because it gives you the freedom and access to all WordPress features out of the box.

To start an online marketplace using self-hosted WordPress you will need the following:

  • A domain name (For example, wpcademy.com)
  • Web hosting account (This is where your website’s files are stored)
  • SSL Certificate (To securely accept online payments)
  • WooCommerce (best WordPress eCommerce addon)
  • Online marketplace addon

The entire setup can take up to 40 minutes, and we will walk you through every step one by one.

Ready? Let’s get started.

Step 1. Setting up Your Ecommerce Platform

First step is to buy a domain name and a web hosting account. You don’t just need a web hosting, but you will need a service that specializes in WooCommerce hosting because this is the software that we will be using as our eCommerce platform.

Typically a domain name costs $14.99/year, web hosting 7.99/month, and SSL certificate 69.99/year.

Now this seems like a lot of money if you are just starting out.

Fortunately, Bluehost an officially recommended WordPress and WooCommerce hosting provider has agreed to offer our users free domain + SSL and discount on their cloud WordPress hosting.

Basically, you can get started for $6.95 / month.

→ Click Here to Claim This Exclusive Bluehost Offer ←

Once you have purchased hosting, then follow our step by step tutorial on how to start an online store for complete setup instructions.

You would now have a WordPress website with WooCommerce installed on it. However, by default WooCommerce assumes that your website is a single vendor website, so it is not possible for other users to add their own products to your website.

Let’s change this.

Step 2. Turn Your WooCommerce Site into an Online Marketplace

First you need to install and activate the WC Vendors plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, head over to WooCommerce » WC Vendors page to configure marketplace settings.

On this screen, you need to set a commission rate that you will pay to each vendor. This rate could also be overridden for individual products or vendors.

The default settings on the page will work for most sites, but you can review and change them as needed.

Don’t forget to click on the ‘Save General changes’ button to store your settings.

Next, you need to switch to the products page. On this screen, you can choose which items to hide from vendors when they are adding a product.

WC Vendors allows you to setup vendor capabilities and permissions. Head over to the Capabilities tab on the WC Vendors settings page.

Next item on the WC Vendors settings page is to setup pages.

The plugin will automatically create pages to use for vendor dashboard, shop settings, and orders page. You can use a different page if you would like by using the shortcodes shown below each page.

One page that is not automatically created by the plugin is the terms page. These are the terms that a vendor has to agree to when submitting their application.

To create a terms page, you can simply create a new page in WordPress and add the terms and conditions in plain text describing what vendors can sell, how they will get paid, how to settle disputes, etc.

Once you have created a terms page, you can return back to this section and select your newly created page here.

The final item on WC Vendors settings page is the most important one, the Payments. By default, WC Vendors uses PayPal Adaptive Payments to pay vendors.

You will see a link to setup PayPal adaptive payments. After you have set it up, you can choose when you want to pay the vendors.

Now that WC Vendors is all set up, let’s setup WooCommerce for a multi-vendor environment.

Step 3. Enable Account Management in WooCommerce

First you need to visit WooCommerce » Settings page and click on the ‘Accounts’ tab. From here you need to check the boxes next to customer registration option.

Don’t forget to save your changes.

Step 4. Setting Up Navigation Menus

Now that your multi-vendor marketplace setup is finished. It is time to make it easy for your users to find their way around your website.

To do that, you need to visit Appearance » Menus page. You will need to add your user account and checkout pages to the navigation menu.

adding-menu-items

Don’t forget to click on the ‘Save Menu’ button to store your changes. For more detailed instructions, see our guide on how to add navigation menus in WordPress.

If you don’t have a My Account page, then simply create a new page in WordPress and add the following shortcode in the post editor.

[woocommerce_my_account]

Step 5. Testing Your Marketplace Website

Your online marketplace website is now ready for testing. You can visit your website in a new browser window and create a new account by clicking on the My Account link at the top.

testsite

From here, both customers and vendors can login to their accounts as well as create a new account.

Once users create a new account, you will recieve an email notification. If you are unable to recieve email notifications, then take a look at our guide on how to fix WordPress not sending email issue.

You can also view new vendor applications by visiting Users » All Users page. You will see all new vendor requests as ‘pending vendor’, and you can approve or deny applications by clicking the link under their username.

Approve vending vendors

Once approved, these vendors can log in to their accounts and add their products by visiting their vendor dashboard. They can also view their orders and sales reports.

Vendor dashboard

The first thing your vendors need to do is to setup their shop settings by clicking on ‘Store Settings’ link.

Shop settings

They will need to provide their PayPal email address to recieve payments. After that they can enter their shop name and description.

Once a vendor adds a new product, you will get a notification email and see an icon next to the products menu. You can then edit a product, approve it, or delete it.

Pending products

Your shop page will clearly show the products sold by vendor’s shop name.

Sold by vendor

We hope this article helped you learn how to create an online marketplace using WordPress. You may also want to see our pick of the best WooCommerce themes, best WooCommerce plugins, and the ultimate WordPress SEO guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Easy Guide to Add YouTube Subscribe Button in WordPress

In this article, we will show you how to add a YouTube subscribe button in WordPress.

 

Method 1: Manually Adding YouTube Subscribe Button Code

The first thing you need to do is visit the YouTube subscribe button page on the Google Developer’s website.

 

On this page, you will need to enter your YouTube channel’s name, select a layout, theme, and subscriber count option. It will display a live preview of how your button will look on the website. Once you are satisfied, simply scroll down to copy the embed code.

Next, you need to login to the WordPress admin area of your site and go to Appearance » Widgets. There you will need to drag and drop a text widget to your widget area, and paste the YouTube subscribe button code inside the widget.

Once you are done, don’t forget to save your changes and visit your website to see the YouTube subscribe button in action.

 

Method 2: Using Plugin to Add a YouTube Subscribe Bar

Another way to add a YouTube subscribe button on your website is by adding it below every YouTube video on your site. This offers additional exposure and can help you significantly increase your subscribers.

First you need to install and activate the YouTube Subscribe Bar plugin.

Upon activating the plugin, you need to go to Settings » YouTube Subscribe Bar to add your YouTube channel ID. You will also need to style the button layout, choose a button theme, and show subscribers count.

The YouTube subscribe bar plugin allows you to add some text before the button and edit its styling. You can use this area to add a call to action like “Subscribe to My Channel”.

Once you are done, make sure to click on the Save Changes button to save your settings.

This plugin will automatically display your YouTube Subscribe bar below every YouTube video on your site. The YouTube Subscribe bar will appear on the videos from your channel and third-party channels, so you can share useful video content on your site and get more subscribers on your YouTube channel.

 

Note: The YouTube subscribe bar plugin only works with oEmbed videos. It will not work with videos embedded via iFrame.

We hope this article helped you add the YouTube subscribe button in WordPress. You may also want to check out our guide on how to track user engagement on your WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Easy Guide to Modify the Help Dropdown Text in WordPress Admin Area

Modify the Help Dropdown Text in WordPress Admin Area

Each WordPress admin screen has a Help button. This area drop downs and contains text that helps the user understand the features of the specific page. When creating a custom site for your clients or a plugin, then you may find a need to modify the Help Dropdown text. In this article, we will show you how to modify the help dropdown text in WordPress admin area.

First open your theme’s functions.php file and paste the following code:

1
2
3
4
5
6
7
8
9
10
add_action('load-page-new.php','custom_help_page');
add_action('load-page.php','custom_help_page');
function custom_help_page() {
  add_filter('contextual_help','custom_page_help');
}
function custom_page_help($help) {
  // echo $help; // Uncomment if you just want to append your custom Help text to the default Help text
  echo "<h5>Custom Help text</h5>";
  echo "<p> HTML goes here.</p>";
}

This code above will add custom help text on every Add New Page screen. You can do this for your posts page, or any other screen. This is something that we will be utilizing for our plugins that we have intentions of creating.

Source: Sixrevisions Blog

Easy Guide to Remove Menu Item in WordPress Admin Panel

Remove Menu Item in WordPress Admin Panel
WordPress admin panel comes with a lot of options in the menu, but you can get rid of them fairly easily if necessary. With one of our clients, we needed to get rid of few menu items, so it is easier for her to understand things. In this article, we will show you how easy it is to remove a menu item in the WordPress Admin Panel.

For WordPress 3.1 or above, just paste the following code in your theme’s functions.php file:

1
2
3
4
add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
    remove_menu_page('link-manager.php');  
}

In version prior to WordPress 3.1, you would need to paste the following code in your theme’s functions.php file:

1
2
3
4
5
6
7
8
9
10
function remove_menus () {
global $menu;
    $restricted = array(__('Links'));
    end ($menu);
    while (prev($menu)){
        $value = explode(' ',$menu[key($menu)][0]);
        if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
    }
}
add_action('admin_menu', 'remove_menus');

The code above will get rid of the Links option for all users (including administrators). Only two user roles are allowed to see the Link tab (Administrators and Editors). Now if this is for a multi-author site (where there are many editors), and you as an administrator still want access to the Links menu, then you can add parameters to do so.

You would need to utilize the function current_user_can(), and with a simple if statement, you can get rid of the link menu or other items for specific user role.

This is a very handy trick for consultants and developers who work on larger sites.

Additional Sources

Remove Menu Page
Current User Can Function Reference
User Roles and Capabilities Chart

How To Install SquirrelMail on CentOS 7

SquirrelMail on CentOS 7

Squirrelmail is one of the most popular Web-based email clients written in PHP. It has built-in pure PHP support for IMAP and SMTP, and it is designed to render all pages in pure HTML 4.0 with no JavaScript required, for maximum compatibility across browsers.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation SquirrelMail email clients on a CentOS 7 server.
Install SquirrelMail on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum install epel-release
yum -y update

Step 2. Installing SquirrelMail on CentOS 7.

Install SquirrelMail using the yum default package manager:

yum install squirrelmail

Step 3. Configure SquirrelMail.

Once the webmail client is installed, you can configure it according to your needs by running the configuration script:

cd /usr/share/squirrelmail/config/
./conf.pl

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit

Command >>

There are different settings in the configuration file, but the main things that should be checked and configured are:

Set your default domain name (2. Server settings > 1. Domain)
Addresses of IMAP and SMTP servers.
Type of IMAP server.

Step 4. Accessing SquirrelMail.

SquirrelMail will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/squirrelmail or http://server-ip/squirrelmail and complete the required the steps to finish the installation.

Congratulations! You have successfully installed SquirrelMail. Thanks for using this tutorial for installing SquirrelMail email clients in CentOS 7 systems. For additional help or useful information, we recommend you to check the official SquirrelMail web site.