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

Change the Default Search URL Slug in WordPress – Easy Guide

Change the Default Search URL Slug

WordPress search URLs are not user friendly. In this article, we will show you how to easily change the default search url slug in WordPress and make it more SEO and user friendly.

Why Change Default Search URL Slug in WordPress

WordPress uses SEO friendly URL structure for all pages on your website. Typical SEO friendly WordPress URLs look like this:

http://example.com/some-page/
http://example.com/2018/03/some-article/
http://example.com/category/some-category/

As you can see, these URLs are quite easy to understand for users as well as search engines.

However, WordPress still uses non-friendly URL for search results page. A typical search URL in WordPress looks like this:

http://example.com/?s=search-term

This URL structure doesn’t match the rest of your website URLs. While some WordPress search plugins improve the search results, most don’t do anything about the search URL itself.

What if you can make your search URL look like:

http://example.com/search/your-search-term/

Let’s take a look at how to make the WordPress search page URL slug more SEO friendly.

Changing Search Page URL Slug in WordPress

For this tutorial you will need to edit your WordPress theme files. If you haven’t done this before, then please take a look at our guide on how to copy and paste code in WordPress.

Method 1. Change WordPress Search URL Slug via Functions File

This method is easier and recommended for most users.

First, you need to copy and paste the following code in your theme’s functions.php file or a site-specific plugin:

function wpb_change_search_url() {
    if ( is_search() && ! empty( $_GET['s'] ) ) {
        wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
        exit();
    }   
}
add_action( 'template_redirect', 'wpb_change_search_url' );

Don’t forget to save your changes.

You can now go to your website and try using the search feature. You will notice that the search URL looks like this:

http://example.com/search/your-search-query/

Method 2. Change Search URL Slug via htaccess File

The .htaccess file is often used to set up redirects and other website configuration tasks. You can also use it to change the default search URL slug in WordPress.

Your .htaccess file is located in your website’s root folder, and you will need to use FTP or File Manager app in cPanel to edit it. Refer to this guide, if you can’t find the .htaccess file.

In your .htaccess file, you need to paste the following code at the bottom:

# Change WordPress search URL
RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
RewriteRule ^$ /search/%1/? [NC,R,L]

Don’t forget to save your changes and upload the .htaccess file back to the server.

You can now go to your website and use the search feature. You will notice the search URL will now look like this:

http://example.com/search/your-search-query/

We hope this tutorial helped you change the default search URL slug in WordPress.

 

Easy Guide to Restore the Get Shortlink Button in WordPress

In this tutorial, we will share how to restore the get shortlink button in WordPress.

What is the Get Shortlink Button in WordPress?

Get Shortlink button is a WordPress feature that allows you to easily get a short link of your WordPress blog post or page. It used to be located right next to the permalink area in the post edit screen.

However if you recently started your blog, then you will not see this feature on your WordPress site because it was removed after WordPress version 4.4.

Let’s take a look at how to bring back the get shortlink button back in WordPress.

Method 1: Using WP Bitly plugin to Add Get Shortlink Button

This method is easier and recommended for most users. This method also allows you to create custom branded short URLs for your website.

Step 1: First thing you need to do is install and activate the WP Bitly plugin. For more details, see our step by step guide on how to install a plugin in WordPress.

Step 2: Upon activation, this plugin will automatically add the Get Shortlink button on your post edit screen.

Step 3: Once you click on this button, it will show you the shortlink for your WordPress posts and pages. This shortlink can be shared in your emails and messages, so your audience can reach directly to the page.

You can also use the WP Bitly plugin to create custom branded shortlinks for your blog posts like we do on WPCademy. See our step by step guide on how to create your own customized short url in WordPress.

Method 2: Manually Adding Get Shortlink Button

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

Step 1: You will need to add the following code to your WordPress theme’s functions.php file or a site-specific plugin:

add_filter( 'get_shortlink', function( $shortlink ) {return $shortlink;} );

Step 2: This code will add the shortlink filter to display the Get Shortlink button in your WordPress pages and posts.

Step 3: You can click on this button to get the shortlink for your post or page.

We hope this tutorial helped you bring back the Get Shortlink button in WordPress website.