How to create a Custom Post Type? Full guide with steps

WordPress is a great tool for creating functional websites. Most people consider WordPress as just a blogging platform. But the truth is wordpress is an extremely powerful platform to create different types of fully functional websites. Each new release of wordpress includes many features to enhance functionality of your WordPress site. In this article we will explore one such feature called ‘custom post types’ in WordPress. WordPress added this in version 3.0 onwards

What is custom post type? Do I need it?

Basically WordPress is designed to be a blogging platform. When it comes to creating content for your WordPress site, you can write either posts or Pages. By default, WordPress comes with certain post/page writing structure. i.e. your post title in the upper field, post body content in the main post editing box below it, select a category, add tags etc. In some situations, you want to create something different than this.

Examples of Custom Post Types
For example, you have a tech blog where you write IT-related news, events, updates etc. Now you want to add a product review section to your site and you do not mix this with regular blog content. You want to create a separate section for these Reviews. I’m sure  you want to use a different structure and different set of data inside your review post. You can extend the existing WordPress infrastructure and accomplish this using ‘custom Post types’ along with ‘custom fields’.

Custom Post types allow you to create new content sections on your site. It will add a new administration menu, dedicated editing pages, custom taxonomies and many more utilities required for full fledged publishing.

Some other examples are:

  • A food blogger wants to rate recipes book post
  • A music blogger wants add a post to sell music album cds
  • A travel blogger wants to list popular  tourist destinations
  • Many popular WordPress plugins also use custom post types. Some examples are : Countries Plugin, WP e-Commerce Plugin,
examples
examples

Make A Product Review With WordPress: Custom Post Types & Custom Fields

In this article I’ll explain how to create a custom post with an example. Let us see how to create a product review custom post. We’re going to add a new section of our website “Product Reviews” that is dedicated for product reviews. You can implement this using custom post types and custom fields. Please note that you’ll need to be familiar with PHP to adjust code based on your needs.

Step 1: Create a Custom Post Type

The easiest way to create a custom post type in WordPress is by using a plugin called Custom Post Type UI .

  1. Install & Activate Custom Post Type UI plugin. (Refer the article How to install a WordPress Plugin)
  2. Upon activation, the plugin will add a new menu item in your WordPress admin menu called CPT UI
  3. Go to CPT UI » Add New to create a new custom post type.

    Add new
    Add new
  4. In this page you can see two columns. Custom Post Type UI plugin allows you to create custom post types (On your left) & custom taxonomies (On your right).

    Create custom post type
    Create custom post type
  5.  Create Custom Post Type – On your left, fill out the Post Type Name, Label fields and description. At the bottom you can see 2 links “Advanced Label Options & Advanced Options” . You can leave the default, or you can click on it to set new values.  After filling click on the ‘Create Custom Post Type’ button to add your new custom post type.Now you can see new menu item in your WordPress admin left menu bar (just like posts /pages menu). The label entry will appear in your WordPress admin left menu bar.  (See fig below). In my case I used the text “product reviews”.

    Post type label
    Post type label
  6. Custom  taxonomies – WordPress uses taxonomies to group post together. Two popular wordpress taxonomies are Categories and Tags. When you create a custom post type called product review, even though you can use categories, you may not want to mix this review with regular blog because they are used differently. So it is a good to create custom taxonomies to group custom posts.For example, create a new custom taxonomy called Review categories. Then you can add topic terms like: Computer, TV, Phone, etc. This would allow you and your users to sort reviews by each topic.Custom Post Type UI plugin allows you to create custom taxonomies. Go to CPT UI » Add New. In this page you can see fields to create custom taxonomies (On your right). Enter the fields Taxonomy Name, Label and Attach to Post Type( Note: Since I’m creating this custom taxonomy for custom post type, I selected Product reviews).
    create taxonomy
    create taxonomy

    At the bottom you can see 2 links “Advanced Label Options & Advanced Options” . You can leave the default, or you can click on it to set new values. I just want to mention one option listed there >> hierarchical == false.

    Now You can see new menu item to add Review Categories. Click on it and create new topics.

    Add Review Categories
    Add Review Categories

    create custom taxonomy
    create custom taxonomy
  7. Now your custom post type is ready. From your WordPress admin left menu bar click on your newly created custom post type( In my case I used the text “product reviews”). Here you will see a regular post writing page on WordPress. But when you create a product review, you need to add additional information associated with each product. For e.g. a database of digital cameras for instance might need:
    • Pros
    • Cons
    • Purchase Link
    • Rating

    Rather than adding this info directly to the description of the product, It is wise to create custom fields to hold this info.

Step2: Adding Custom Fields to a Custom Post Type

Since WordPress native custom fields capability is not enough for our need, we are going to use a third-party plugin (read A Guide to WordPress Custom Fields). Here I’m using Advanced Custom Fields plugin. Advanced Custom Fields is a free plugin that let you create different types of custom fields, create them as a group and then assign that group to your custom post types. Many add-ons also available for this plugin. For e.g. if you want to use star rating , use this acf add-on.

  • Download, install and activate Advanced Custom Fields. (Refer the article how to install a plugin)

    Advanced Custom Fields
    Advanced Custom Fields
  • After installing you will see custom fields menu link on left sidebar.
    custom fields
    custom fields

    Here you can create a set of fields(called field group) and then assign this to your custom post types.

    custom fields
    custom fields

    Click on “Custom Fields” and create a field group called “Product Review” . Click “Add Field” to create the fields needed. In this example I’m adding fields like “Pros”, “cons” etc.

  • In the “Location” section, you can assign this field group to your product review custom post type.

    Custom fields
    Custom fields
  • In the “Options” section, you can configure how you want your field group to be displayed. You can also decide which all other default WordPress inputs to be hidden when the field group is displayed.

    Display Options
    Display Options

Create a product review

Now that you created your cusom post and template, we will now see how you can create your custom post:

Post type label
Create new product review

From your wordpress admin left menu Click Product Reviews >> Add Product Review.

Create product review
Create product review

Write and publish a product review. But when you view the post that is just created, WordPress template hierarchy will use default single.php template file. There these custom fields values will not be displayed. So next step: we need to work on a template that includes these custom post types into our site so they display properly. To display these custom posts, you need to either edit default template file or create a custom single post template.

Step3: Create Single Post Templates for Custom Post Type

Let us see how you can create a custom single post template. To display your Custom Post Type you need to create a new file name single-YOURCUSTOMPOSTNAME.php in your theme folder. So let’s say your custom post type is called”Productreview”, then you need to create single-productreview.php to display your single custom post.

Duplicate single.php
Duplicate single.php

Make a copy of the single.php file in your theme directory. Rename it to single-productreview.php. This isn’t something you can do from the wordpress dashboard. You need to copy the file using your hosting control panel or FTP application.

  • Refer this article to see how to FTP it to your theme directory.
  • Refer this article to see how to make a copy of single.php using cpanel.

Now go back to Appearance > Editor in your WordPress dashboard, select your theme, and the single-productreview.php file name in the right sidebar. Here you can add code to display custom fields or customize look and feel.

 

Displaying Custom Fields
To display the Custom Fields, Put the following tag within The Loop. Find where your main WordPress Loop originates.

loop starts
loop starts

Call the wordpress function  get_post_meta().

custom fields
custom fields

Assign the name of the key that you want to appear. For example in my case, I want to display custom field called “pros”.

I hope, by now you understood about custom posts are and custom fields. There  are many plugins available to enhance WordPress posting abilities. I suggest doing your own research and find the best solution to your need.

 

How to Update WordPress Releases, Plugins and Themes automatically

So, what do you do if you see an update message (“ xx.x is available! Please update now”) in your WordPress Admin Screens? Never ignore that message. There are enormous variety of Scams and other malicious activities circulating around the internet. When wordpress notice a new malicious activity, they add updates to defend against them. WordPress constantly add new features, improvements and release ‘updates’ at regular intervals. Well, not just the WordPress core, but also plugins and themes providers also release ‘updates’ at regular intervals.

Check current site for updates
To check your website for WordPress Core, plugin, or theme updates, log into your wordpress admin and click Dashboard>>Updates.

Updates menu
Updates menu

You can see list of updates there.

updates available
updates available

Note: If a WordPress Plugin update is available, it also will be shown on the Plugin’s menu title, and on the Plugin List Page. If a WordPress theme update is available, it also will be shown on the theme List Page(Appearance>>Themes). You should always update WordPress Releases, Plugins and Themes to the latest version to make sure your website is also up-to-date with new features and security updates.

Version 3.7 onwards WordPress introduced automatic updates for minor releases (For example, it will automatically update itself from WordPress 3.7 to 3.7.1.). But this Auto update is not enabled for major releases like 3.7 to 3.8.

Update/upgrade your WordPress core, themes and plugins easily

Sure, updating can be a pain, but now you are able to update/upgrade your WordPress and plugins to a newer version easily and users never even realize that WordPress has updated. If your site is hosted with a managed WordPress hosting, the host usually takes care of automatic updates. For other users, you can enable automatic updates in 2 different ways.

Method1: Using Advanced Automatic Updates plugin

Method2: Edit your wp-config.php file

  • Login to the Cpanel and then click on the File Manager icon in the Files section.

    click on the File Manager icon
    click on the File Manager icon
  • You’ll see a pop-up window. Select your site and click on GO in order to proceed.

    click Go
    click Go
  • The wp-config.php is the file contained in the root of your WordPress file directory. Click on it and from the top menu choose “Edit”.

    Open file to edit
    Open file to edit
  • Add the following to enable major WordPress Releases updates
    Add the following line of code in your site’s wp-config.php file.
    automatic-update4
    Add the following to enable plugins updates
    Add the following line of code in your site’s wp-config.php file.

    Plugin update
    Plugin update

    Add the following to enable themes updates
    Add the following line of code in your site’s wp-config.php file.

    theme update
    theme update
  • Once you’ve finished editing the file click on SAVE CHANGES in the top right hand corner.

 

How to create a sortable table in WordPress?

Last week,  I did a wordpress article that does a Speed comparison of Best ThemeForest WordPress Themes.

Initially I collected and compiled my data in a Google drive spreadsheet. Once data was ready, I wanted to present the data in a wordpress post, in a way that reader should be able to sort the data by any column(ascending or descending). So I was in search of a good plugin that can help me do so.

There are couple of good plugins for fancy table display in wordpress posts. But I chose Easy Table Plugin, based on its features as well as user ratings and reviews in wordpress.org site.

At the end of this article, we’ll also have a quick look at Posts Table Pro. This plugin is an interesting alternative to Easy Tables because instead of entering data to your WordPress tables manually, it automatically creates tables listing content already stored on your website.

Easy Table Plugin

easy-table-screenshot

 

Idea behind this plugin is to generate table data using CSV(Comma Seperated Values) format. With simple additions, you table data is ready for display in your wordpress page or  post or even inside a widget. Good thing is this is very simple to use and you don’t need advanced skills to use it.

Let me illustrate this with a simple table example here. Now, if you mouse over any column, a sort icon appears. You can click this icon to sort that column in ascending or descending order. So simple.

Year Make Model Length
1997 Ford E350 2.34
2000 Mercury Cougar 2.38

 

So let us see how to install this plugin and then how to use it.

Install Easy Table Plugin.

  1. Log into your wordpress admin.
  2. Go to Plugins >> Add New.
  3. In the search box enter ‘Easy Table’ and search.
  4. Select ‘Easy Table’ from search results and click on the link ‘Install Now’.
  5. Go to Plugins >> Installed Plugins. Find Easy Table and activate the plugin.

How to use Easy Table. A full example :

Generate table data using CSV(Comma Separated Values) format.

Table data in CSV format means text that is separated with a comma. You can create a CSV using a text editor such as Notepad, Microsoft Excel and Google Docs. Here we are using Google docs for demo purpose.
Open Google Drive >>Click on Create >> Spreadsheet.

Create CSV
Create CSV

Enter data and and click File, Download as, and then select CSV (current sheet).

easy-table-steps1
Generate table data using CSV(Comma Separated Values)format

Open CSV in Notepad.

Open CSV
Open CSV

Step 2: Embedd CSV data between <table> and </table> tags

Create a new post and embed table data. Actually you can embed csv data in 2 ways.

Method 1: Copy and paste CSV from notepad.

embedded
Embed table data

Look at the table data here. The entire table data is embedded between<table> and </table>.  First row is reserved for table titles(Note: you can also create table with no heading using table parameter.). And you see that next 2 rows in the example are data rows. So simple.

Method 2: Upload CSV file and insert the file path

Easy table
Embed file path

Look at the table data here.  Save and upload the CSV(Comma Separated Values) . Insert the location of your file  between<table> and </table>( See fig above).

The result:

Year Make Model Length
1997 Ford E350 2.34
2000 Mercury Cougar 2.38

Other Features

You can add additional parameter to this <table> tag and use cell attribute to control other features of table.

Table with initial sort order on load

You can control sort order on load in 2 ways. Add sort=”desc” or sort=”asc” to <table> tag.
Method 1: Using table parameter Table with initial sort order using table parameter. See the table example below. First column is sorted descending on load.

Year Make Model Length
1997 Ford E350 2.34
2000 Mercury Cougar 2.38
2010 Nissan Micra 4.38

Table with initial sort order
Table with initial sort order

Method 2: Using cell attribute

Initial sort order
Initial sort order

Table with first column descending, second column ascending
For example, the following table on load sort first column descending and then sort second column ascending.

Year Make Model Length
1997 Ford E350 2.34
1998 Maruthy Zen 3.38
2000 Mercury Cougar 2.38
2000 Nissan Micra 4.38
2000 Maruthy Zen 3.38
2000 BMW Micra 4.38

Table with initial sort
Table with initial sort

Disable sort for any column

Look at the table below. Sort for third column is disabled here.

no Item Kg Price
1 Orange 2 100.00
2 Grapes 1 75.25
3 Pinapple 5 130.00
4 Mango 8 250.00

You can do this 2 ways.
Method 1: Add a table parameter  ‘sort=,,false’.

table parameter
table parameter

Method 2: Add a cell attr  ‘sort=false’.

cell attr
disable sort by adding a cell attr

Set index to table

For example see following table with auto index, start from number 2

No.head1 head2 head3
2row1col1 row1col2 row1col3
3row2col1 row2col2 row2col3
4row3col1 row3col2 row3col3
5row4col1 row4col2 row4col3

 

initial sort order
initial Index

In addition to setting auto index to a table, you can give a title to that column and you can set width of that column.

auto index
auto index

Other features

For example see following code shows how to add table parameter to create a table with specific width, style etc.

 Adding table parameter
Adding table parameter

Following code shows how to use attribute in some cells.

attribute in cells
attribute in cells

Posts Table Pro

Alternative table plugin – Create instant WordPress tables with Posts Table Pro

As you can see, Easy Tables is a neat plugin that lets you display static data in a table on your WordPress site. Before we finish, I’ll tell you about another WordPress table plugin that lets you create instant tables without having to enter data manually.
Posts Table Pro works by generating tables of information already stored on your WordPress website. It’s a great alternative to Easy Tables if you want tables that will automatically update with the latest data. Here are some examples of websites that would benefit from this type of WordPress table plugin:
  • Index of blog posts or articles – It doesn’t take long for a WordPress blog to become so big that it’s hard for visitors to find your older posts. No one wants to scroll through multiple pages of posts! Use Posts Table Pro to create a blog post index or article directory, which will automatically update when you add a new post.
  • Document library or knowledge base – If you want to create a WordPress document library then you can create a ‘Documents’ post type and use Posts Table Pro to list your documents in a table view. Your visitors can either download the document directly from the table, or click through to a single page for each document. You can categorize documents and add filters to help customers find the documents they need. 
  • List of events or e-commerce products – Amazingly, Posts Table Pro can list any WordPress post type in a table. This opens the door to many other possible use cases. For example, if you’re using a WordPress events plugin or e-commerce plugin then you can list your events or products in a table layout too. 
The dynamic table plugin is easy to set up and comes with lots of options. There’s a detailed plugin knowledge base to help you configure your WordPress tables in any way you like. 


So we have seen how to use “Easy Table” plugin to create a nice sortable table. Have you created sortable tables using other plugins? Share your experience below.

 

How to install a WordPress Theme the right way?

How To Install a WordPress Theme

As a beginner,you have probably heard of various free and paid themes available online. You may have tried out a few themes until you’ve found one that meets your needs. In this guide, we’ll show you how to install a WordPress theme.

This guide will cover the three different ways you can install a theme. However, before installing a WordPress theme, keep in mind that once you activated a new theme, it will change how your website looks and functions. If you are switching from an existing theme, then you need to do several checks first before changing to a new WordPress theme.

Here are the different ways to install a WordPress theme.

  1. Select a free theme from the WordPress.org theme directory >> Install& activate
  2. Download a theme from any other theme directory >> upload zip by using Upload Method from WordPress dashboard >> Install& activate
  3. Download a theme from any other theme directory >> upload theme files using FTP >> activate

How to install WordPress theme from the dashboard

  1. Log into your WordPress admin area. Next, click on Appearance » Themes.
    Install theme
    Install theme

    On the themes page, you will see your current theme and all other themes you have currently installed in your server. You can preview and activate any theme from this list.

  2. To add a new theme, simply click on Add New button at the top.
    Install  theme
    Install theme

    There are lots of free and paid WordPress themes available. On this page you can either select a free theme from the WordPress.org theme directory or upload a theme from your local hard drive.

  3. You will have the ability to select free themes from: Featured WordPress themes, Popular WordPress themes, Latest WordPress themes, search for a specific theme, or search for themes with specific features.

    Install theme
    Install theme
  4. After selecting the theme that you want to install, simply bring your mouse on top of the image.
    Install theme
    Install theme

    You can preview the theme by clicking on preview button or install the theme by clicking on the install button. WordPress will now install your theme and show you a success message along with the link to activate or live preview.

  5. Click on the activate button, and you’ve successfully installed and activated your WordPress theme.

    Install Theme
    Install Theme

Install a Theme by using Upload Method from WordPress Admin

If you are want to give more a professional look to your blog or add more functionality to your blog, there are many premium(Free & Paid) WordPress themes available. You can download these premium theme from the theme directory sites. They provide these premium theme in .Zip format, which you can use to install WP theme directly from dashboard.

  1. Log into your WordPress dashboard. Navigate to Appearance> Themes > Add New

    Install theme
    Install theme
  2. Click on browse, select & locate your .zip file for theme and click on Install now. Once you click on Install now, your theme will be uploaded and will be installed on your server.

    Install theme
    Install theme
  3. On the next screen, you will see an option to activate the theme.

    Install theme
    Install theme

Installing a WordPress Theme using FTP


Most people are able to upload their themes from WordPress dashboard. But there are times when their web host provider is too strict and not able to do it from dashboard. Then you need to upload files manually to your web server. The most common way to do this is by using an FTP or SFTP (Secure) client. For doing so, you need to have:

  1. An SFTP client installed in your machine. (To learn more about configuring your SFTP client – View FileZilla installation tutorial.)
  2. A software like WinRAR to unpack .zip file. (If you don’t have any WinRAR installed, download the free version of WinRAR and install it). Alternately, you can open Compressed Folder in Windows Explorer.
  3. FTP login details and server address – FTP information can be found in the welcome email you got after you pay for your new hosting account. Find your FTP Host/Address, FTP User & Password

Theme Upload Instructions

  • Unzip your theme .zip file somewhere on your local computer.

    Install theme
    Install theme
  • After extracting the .zip file, upload the entire theme folder via SFTP to your /wp-content/themes/ directory.
    Install theme
    Install theme

    (file transfer type should be “Auto” and not “ASCII” or “Binary”. This is the default for FileZilla.)

  • How to activate any installed theme from this list – Once you done with the upload and installation using dashboard or FTP method, you can browse all installed themes from your WP dashboard.
    Install theme
    Install theme

    Log into your WordPress admin area. Next, click on Appearance » Themes.. You can Preview or activate the theme directly from here.

We hope this step by step guide helped you install a WordPress theme on your site.

The Best Copywriting Tips for 2013

For users to gain interest in our blog, a good copy is an effective way to attract them. If you not a writer, nor a journalist, you will have a hard time catching writing a copy that can attract customers. However, don’t fret because with practice and discipline, improvements will follow. Just don’t be tempted to procrastination, and all will be well.

A guest post from skyje.com has the best tips for creating a good copy and how long will it take to improve your copywriting skills. Remember that a good copy is a skill that can be honed with proper practice.

Learn The Basics of WordPress Plugins

WordPress.org is a state-of-the art blogging platform in which you need to perform several things to make it uniquely you. A good way to customize your WordPress site is to use plugins. Plugins improve the way how your site performs like their load speed, and how it can interact with your customers. The question is, do you know how to install a plugin? How do you use a plugin? Or even know how to activate it? Skyje.com explains  a definitive guide or A to Z of WordPress from what Plugins are, how they are used, and where to download a plugin.

Read the full explanation here: http://skyje.com/wordpress-plugins-guide/

How Viral Content Can Attract Members to Your Site

If you want to attract members to your WordPress membership site, the best way is to use free content. No matter what niche and type of site you have, you can’t attact members without free content. What is even better is that your free content goes viral.

Good quality content makes a WordPress blog successful as it will rank well in search engines. It helps people to notice you and bring them to your site where they can be one of the paid subscribers one day. However, you cannot make it happen if your content is not popular online. One way to make your content popular is by turning a content into viral content.

Read how its done here: http://skyje.com/wordpress-membership-site/

WordPress Mu on Arvixe

WordPress MU is the multi-user version of the WordPress blogging application, which allows you to run hundreds of thousands of blogs with a single install of WordPress. The main advantage of WordPress MU is that it makes updates extremely easy. You can control and moderate all the blogs from a single dashboard. (Note: WordPress 3.0 and above has the functionality of WordPress Multiuser). WordPress MU is ideal for enterprise users looking for a large scale blogging solution for intranet deployments, schools and versions universities who want to offer blogs to all their students and teachers, or individuals looking to host multiple blogs for their personal or business needs.

  • WordPress MU makes it possible for those with a website to host their own blogging community. WordPress MU allows your user to run their own wordpress blog. For example, if you have a blog for your school NHRschool.com, then you can let the students to create blogs like james.NHRschool.com, or mary.NHRschool.com.
  • It can also be used to run separate sites on their own domain. For example, let’s say you have a site about ticketbooking and you want to create several blogs for the different forms of ticketbooking like movie-ticketbooking.com, baseball-ticketbooking.com, park-ticketbooking.com, basketball-ticketbooking.com ect. Then you can install WordPress MU on one of the domains and then go to the WPMU administration panel to add the second and third, fourth sites ect. Now have separate sites on one installation of WPMU. Each site can have it’s own unique theme, different plugins, and additional users.

Does Arvixe hosting support wordpress Mu?

Yes you can setup wordpress Mu at arvixe hosting. You can install WordPress MU from your Arvixe cPanel. Sign into your cPanel and follow these steps:

  • Click Softaculous.arvixe-wpmu1
  • Scroll down to “Blogs”. Find the “WordPress MU” link and click on it.arvixe-wpmu2
  • Click “Install”.arvixe-wpmu3
  • Fill out all of the boxes. For “In Directory” type the name of a new directory you would like created. By default, the box will be left blank to install the software into your main directory. Enter the sites name and description. Create the administrators username, password and enter their email address. When you are finished, click “Install”.arvixe-wpmu4

You are done.

Click Here to Visit Arvixe Website