How to use different design/template for different pages in WordPress

Do you want to have different design / appearance for different pages in WordPress? In this article, we will show you how to create and use a custom template for a page in WordPress.

From your wordpress admin, while creating a page you can see a template drop down menu under ‘Page Attributes’ section. Clicking on it will allow you to select the template for that page.
But first you need to create a custom page template and put it under your theme’s directory.

Creating a Custom Page template in WordPress

By default WordPress utilizes a template file called page.php to control the appearance of your pages. You will find it in /wp-content/themes/ directory. Now you need to add a custom page template here. The easiest way to get started is by creating a duplicate of existing page template (ie. page.php) provided by your theme. Rename your file like page-home.php, page-contact.php etc. Now start editing your custom page template file. You can make changes in their layout and appearance. This requires a basic understanding of HTML, CSS, and PHP. Once you are done customizing, upload it back to your theme folder using FTP.

Display Different Sidebar for Each Post and Page for WordPress

In this article I will show you how to choose display different sidebar for each post and page for WordPress. There’s several different plugins that help you gain this type of flexibility with your site.

Easy Custom Sidebars

custom-sidebar
This plugin allows you to replace any sidebar/widget area in any WordPress theme without any coding.

  1. Go to your wordpress admin >> Plugins >> Add new . In the search box type “Easy Custom Sidebars” and hit enter key to search. Install and activate the Easy Custom Sidebars plugin.
  2. custom-sidebar-02 You will see new menu item “Theme Sidebars” under “Appearence” menu. Click on it.
  3. custom-sidebar-03Create new side bar here.
  4. custom-sidebar-04 Replace your old side bar with new side bar.
  5. custom-sidebar-05 Select posts/pages/categories where you want to display this new side bar. Save your side bar.
  6. custom-sidebar-06 Go to Appearance >> Widgets. Drag a widget to side bar. Edit and save it.

Per Page Sidebars Plugin

Content Aware Sidebars

How to Have Different Sidebar Content On Different Pages of Your WordPress Site

Now when you are writing a post or a page, and you want to display a custom sidebar all you need to do is add the custom field “Sidebar” and include the name of the sidebar file. For example if you insert “wpbpage”, it will display sidebar-wpbpage.php as your sidebar.

Custom Sidebars – Dynamic Widget Area Manager

How to Split a long WordPress Post into Multiple Pages – post pagination

You wrote a very long post and have some issues with load times on your posts, it is better to split that long WordPress post into multiple pages. Reading long posts can be hectic or boring for users. This can increase the bounce rate of your site. So for better presentation and readability, divide along post into several pages. This also will improve the look and feel of your site and increase the number of page views on your site.

Dividing your posts into two or more pages is simple in WordPress.

split-post

  • In the post editor, click on “Text” tab to switch to “Text” editor mode.
  • Add the following tag wherever you want to split your post.

    <!–nextpage–>

    You can add this tag anywhere you want as many times as you want.

  • Save your post.
  • Now you can see post pagination.split-post2

Best WordPress Backup Plugins

It is really important to take regular back up of your blog to guard against losing all your data. Luckily, there are plenty of excellent WordPress plugins available that will back up your posts, pages, and whatever else you have on your site. Let’s take a look at some free WordPress backup plugins! Installing plugins from the WordPress Dashboard is so easy. This guide will show you how to install a WordPress plugin.


BackWPup

wp-backup3The BackWPup Free version can be used to save your complete installation including /wp-content/ and push them to an external Backup Service, like Dropbox, S3, FTP, Microsoft Azure, RackSpaceCloud or to Sugar. With a single backup .zip file you are able to easily restore an installation. This plugin is available via the WordPress Plugins Directory. Type “BackWPup” in Search Plugins box and install it.

BackupBuddy

wp-backup6BackupBuddy Premium is a WordPress backup tool that can handle file and database backups easily. However, BackupBuddy Premium isn’t free. For $75 you’ll get 2 site license, and that’s it. No monthly fees, and this license last a lifetime. Get BackupBuddy

VaultPress

wp-backup7VaultPress is a subscription-based protection, security and backup service for WordPress blogs and sites. VaultPress makes it easy to keep an up-to-date backup of your site with both daily and real time syncing of all your WordPress content. Get VaultPress

BackUpWordPress

wp-backup4 BackUpWordPress will back up your entire site including your database and all your files on a schedule and store in your hosting server. Backups are stored on your server in /wp-content/backups. Option are available to email the backup file to you. You can exclude files and folders from your backups. This plugin works on Linux & Windows Server. This plugin is available via the WordPress Plugins Directory. Type “BackUpWordPress ” in Search Plugins box and install it.

Duplicator

wp-backup2 The Duplicator let you create back up of your site. Using this plugin you can also Duplicate, clone, move and transfer an entire site from one location to another. This plugin works on Linux & Windows Server. This plugin is available via the WordPress Plugins Directory. Type “Duplicator” in Search Plugins box and install it.

WP-DB-Backup

wp-backup5WP-DB-Backup allows you easily to backup your core WordPress database tables. This plugin is available via the WordPress Plugins Directory. Type “WP-DB-Backup” in Search Plugins box and install it.

UpdraftPlus Backup and Restoration

wp-backup1 Backup into the cloud (Amazon S3), Dropbox, Google Drive, Rackspace Cloud, DreamObjects, FTP, Microsoft OneDrive, SFTP, SCP, WebDAV, OpenStack Swift and email.Features icnlude Backup automatically on a repeating schedule, Files and database backups can have separate schedules, Large sites can be split into multiple archives, Select which files to backup (plugins, themes, content, other), Download backup archives direct from your WordPress dashboard, Failed uploads are automatically resumed/retried.

Dropbox Backup & Restore

wp-backup8Create Full Backup (Files + Database) of your blog and save locally at your shared hosting / server of your site or upload to dropbox. Using this, you can easily Backup, Restore, Duplicate, Clone or Migrate of your Website. This plugin is available via the WordPress Plugins Directory. Type “Dropbox Backup & Restore” in Search Plugins box and install it.

WordPress Backup to Dropbox

wp-backup9Keep your blogs back up in Dropbox. Choose a day, time and how often you wish your backup to be performed. Your websites files and a SQL dump of its database will be dropped in your Dropbox! This plugin is available via the WordPress Plugins Directory. Type “WordPress Backup to Dropbox” in Search Plugins box and install it.

10 Essential Things To Do After Installing WordPress

There are few basic settings and configurations to do after installing WordPress to ensure reliability, and top of the line performance.

  1. Change The Title, Tagline and Time zone

    • To change these, go to your Settings in your dashboard and choose General.wp-basic-step2
    • Change both your site title and tagline to something that relates to your site. Now scroll down the page to update your timezone.Change The Title, Tagline, Time zone
    • Scroll down the page click on save changes.
  2. Delete the Default WP Admin Account

    By default WordPress Creates ‘Admin’ as a username for your Blog. Hackers know this and has half the equation to try to get your password. To avoid this, use a different admin username.

    • Login using your admin user account. Once logged in goto Users > Add New wp-basic-user-add1 Fill in all the details for a new user account. Choose the Administrator privileges for this new account .wp-basic-user-add
    • Once that new account is created, log out of your “admin” user account and log back in using your new user account that you just created.
    • Once logged in under the new user account, go to to all User list. Pass the mouse over use “admin” and click on “delete” link.wp-basic-user-delete When you do this WordPress will prompt you to reassign all the posts associated with “admin” to another account. Choose your new account from the drop down list.wp-basic-user-delete2
    • Once you have completed the step of deleting your own “admin” account all the posts previously posted under “admin” will be associated with your new account and you are no longer using the default username.
  3. Delete default Posts and page:

    WordPress install comes with default post and pages. Click on Posts from left menu. Hover over the sample post and select Delete. wp-basic-step3You can delete the sample Page in the same way via Admin -> Pages.

  4. Rename Uncategorized Category

    WordPress install comes with 1 default category named Uncategorized. Unlike the post and the comment this category cannot be deleted. When an editor forgets to select a category, WordPress automatically selects Uncategorized category for that article before it is published. When you have blog posts listed as “Uncategorized,” It makes you seem careless, resulting a symbolic black mark against your blog’s reputation. wp-basic-category3
    To rename the uncategorized category Click on the tab Posts > Categories. Bring your mouse over to Uncategorized and an Edit option will appear. Click Quick edit and change your category name and slug to Other.

  5. Set up WordPress Permalink

    By default, WordPress offers permalinks like this:http://www.wordpressluv.com/?p=123. This type of permalink is not search engine friendly and not very user friendly. More descriptive URL with keywords may boost your rankings.Other than this, permalinks will give a brief idea of what your post or page is about without looking at the content and can affect a reader’s decision whether or not to click links to your site. You can change the structure of your permalinks at any time, however doing this changes the URL of your pages. You should set your permalink when setting up your blog for the first time.

    You can find various permalink settings under WordPress dashboard > Settings > Permalink.wp-basic-permalink1wp-basic-permalink2

  6. Activate Akismet

    Akismet comes with WordPress which eliminates comment and Trackback spams without your interaction.

    • To activate that, you need API key from Akismet It is free you can get it from Akismet.com/get.
    • Click the Plugins link on the left navigation menu of the Dashboard to load the Plugins page.
    • Click the Activate link below the Akismet plugin name and description. A yellow box appears at the top of the page, saying Akismet is almost ready. Go to Akismet Configuration and enter API key to activate it.
  7. Update your Profile

    From your wordpress admin left menu, click on Users and update your profile.wp-basic-user-profile

  8. Install new theme

    Give unique look to your blog. Change default style to any of the best WordPress theme that suits your blog. There are plenty of free and premium themes available.
    Elegant ThemesElegant Themes looks great, is easy to use and as plenty of options to make your site uniquely you. It is also a bit cheaper than most premium themes. Browse more themes from StudioPress.com
    These steps will help you install and select a WordPress theme for your blog..

  9. Delete Unused Themes and Plugins

    After you have installed your WordPress theme and Plugins, Delete all unused Themes and Plugins. It will improve your WordPress Performance, security purpose as well as to reduce the server load. Hacker might discover an exploit those unused themes and plugins.

    Delete Unused Themes

    • From your WordPress dashboard go to Appearance > Themes. Here you can see available themes. This include active theme and other unused themes. You can’t delete an active theme. Pass the mouse over unused themes and click on theme details button. Click on it.
      wp-basic-theme-delete1
    • In the preview screen, click Delete button in the right bottom corner of it. Now your theme is successfully removed.wp-basic-theme-delete2

    Delete Unused Plugins

    • From your WordPress dashboard go to Plugins.
    • wp-basic-plugin-delete1wp-basic-plugin-delete2
  10. Install the Essential Plugins

    It is important to install some plugins for better performance of your website. Thousands of plugins are available in the wordpress plugin directory. You can search and see if there is a plugin that fits your need. Refer the article: How to install a WordPress Plugin. Here is a list of 27+ best plugins for a successful wordPress blog.

  11. Start Scheduling Regular Backups

    It is important to take regular backup of your site. It helps to recover your site in case of server crash or when you need a new host. There are so many free and premium backup plugins available that creates backup of your website and keep your site safe and secure.backup buddy

  12. Add Contact me page

    Use plugin Contact Form 7 to add contact page to your site.

How to Use WordPress Widgets

WordPress Widgets are independent content blocks designed to provide  specific function. Widget is a simple and easy-to-use way to arrange the various elements of your sidebar content  or any widgetized areas of your theme. Widgets enable non-technical users to customize your theme without having to change any code.

There are so many different widgets available. WordPress by default comes with several widgets that can be seen on on the WordPress Administration Appearance > Widgets panel. See a list of Top wordpress sidebars widgets. Note: You can install new ones by searching the WordPress Plugins Directory. See how to install worpress plugin.

How to use Widgets

To use/display widgets, you need to add widget areas into your Theme. Most WordPress themes are widget ready. It would always be a good idea to select a theme that is Widget Ready. If  theme is not widget ready, you can widgetize just about every part of your theme. See how to widgetize your theme.

  1. Go to Appearance > Widgets. Here you can see available widgets and widget ready areas in your theme.
    Widget areas
    Widget areas

    If  theme is not widget ready, you can widgetize just about every part of your theme. See how to widgetize your theme.

  2. Choose a Widget and either drag it to the sidebar where you wish it to appear
    drag widget
    drag widget

    Or click the widget, (select a destination sidebar if your theme has more than one) and click the Add Widget button.

    Add Widget
    Add Widget
  3. Preview the site. You can see the new addition there.
  4. To arrange the Widgets within the sidebar or Widget area, click and drag it into place.

    Drag to re-arrange
    Drag to re-arrange
  5. To customize the Widget features, click the down arrow in the upper right corner to expand the Widget’s interface.

    Edit widget options
    Edit widget options
  6. To save the Widget’s customization, click Save.

    Edit widget options
    Edit widget options
  7. To remove the Widget, click  Delete link in the configuration options as show above.

How to add Widget area to your theme

You can widgetize just about every part of your theme. See how to widgetize your theme. Widget can be added to the header, footer, and elsewhere in the WordPress design and structure. There are 2 main parts to  add widget area in your theme:

  1. Register the widget area in functions.php
  2. Insert widget area in the WordPress Theme

#1: Register widget area

Open the functions.php file from the WordPress Theme Editor . Add the following block of code. In this code, we are registering one sidebar. We have given a name(e.g.’Home right sidebar’) to identify them on Widgets screen and  id(e.g.’home_right_1′) is used to call it in theme file to display.

<?php
/**
 * Register our sidebars and widgetized areas.
 *
 */
function wpl_theme_widgets_init() {

	register_sidebar( array(
		'name'          => 'Home right sidebar',
		'id'            => 'home_right_1',
		'before_widget' => '<div>',
		'after_widget'  => '</div>',
		'before_title'  => '<h2 class="rounded">',
		'after_title'   => '</h2>',
	) );

}
add_action( 'widgets_init', 'wpl_theme_widgets_init' );
?>
New widget
New widget

After registering Dynamic Sidebars, New widget area appears in Appearance » Widgets screen. Users can drag and drop widgets into these sidebars.
#2: Insert widget area in the WordPress Theme

You need to  insert the following block of code in your template like sidebar.php /footer.php or any other template file where you want to display the widget.

<div id="home_right_1">
<?php
if(is_active_sidebar('home_right_1')){
dynamic_sidebar('home_right_1');
}
?>
</div>

In this example code, we have used sidebar id(‘home_right_1) to call the sidebar. Change the sidebar id to display another sidebar.

Top 13 WordPress Sidebars Widgets

Widgets are one of the best reasons you should use WordPress. WordPress widgets allows you to add static and dynamic content to widget-ready areas of your theme like in this case, the sidebar. The beauty of these widgets lie in its simplicity and ease of use. To display a widget in your website, all you have to do is drag and drop the widget to its expected location. You can also customize the design and change the way it behaves. The drag and drop interface simplifies the design process by removing the need to modify the theme template.

Ad Squares Widget

Ad Squares Widget
Ad Squares Widget

This widget lets you display 125×125 ads in your sidebar. This plugin supports ads coming from AdSense, PHP, iFrames, XHTML, JavaScript, etc. All you need to do to place ads is to paste the code for each block you want to display.

The widget can display up to 8 squares at once. You can also customize the padding and choose how to shuffle the ad positions. You can even insert a tag that will enable ad rotation. Which means the ad will contain multiple ads and rotate them each time the page is loaded.

Download Ad Squares Widget.


Dynamic Widgets

Dynamic Widgets is a plugin that lets you have full control on the pages a widget will displayed. The interface is easy to use as it takes you to a separate page to control the settings for the widget. It also lets you display the widget according to the user’s role, date and according to the visitor’s browser.

Download Dynamic Widgets.


Category Posts Widget

Category Post Widget
Category Post Widget

This sidebar widget deals with the displaying of recent posts from a specific category. Aside from that, it also lets you change the order of the posts, and allows you to manage the number of posts to be displayed. Gallery Post can be installed multiple times in a page.

Download Category Posts Widget.


Sidebar Login

Sidebar Login
Sidebar Login

This widget adds a useful login form in the sidebar of your WordPress blog. You can use the widget to login to your admin account without the need to visit the URL for that or use it as a login page for your blog subscribers.

To use the plugin, simply go to Appearance>Widgets and drag the sidebar login to the sidebar of your choice.

Download Sidebar Login


 

Simple Subscribe Widget

Simple Subscribe Widget
Simple Subscribe Widget

Simple Subscribe Widget is a sidebar widget that lets you easily add a subscribe button to your page. It doesn’t only work as a widget, you can also use this as a shortcode or simply using php in your template codes.

The plugin comes with ReadyGraph, a set of features that automate the growth of your user base through maximizing conversion of site visitors to register to your email list, maximizing referrals, and maximizing return visits.

Download Simple Subscribe Widget.


Image Widget

Image Widget
Image Widget

Image Widget is a simple widget that uses your WordPress media manager to display images from this widget to your site. This widget can have a title and a description in it, and you can also link the image either to an external URL or to let the users view a larger version of the image. Image Widget supports template overrides which means you can have a different look and feel of this widget to the theme of your website.

Download Image Widget.


Floating Social Media Icon

Floating Social Media Icon
Floating Social Media Icon

Floating Social Media Icon lets you add social media links to your page with style. This widget floats on your page and follows through as the user scrolls to the page. It has more than 2 icon types that you can set to display in order or have a different theme for each icon. You can integrate this sidebar widget manually or automatically. And if you don’t like the icons to float, you are also free to disable it.

Download Floating Social Media Icon.


Widget Twitter

Widget Twitter
Widget Twitter

Widget Twitter lets you display Tweets with the follow button right on the sidebar of your WordPress blog. This plugin allows you to set your twitter account widget id and twitter username. You can also customize the widget by its width, allow to expand the widget images and custom link URL color.

Download Widget Twitter.


Add Link to Facebook

Add Link To Facebook
Add Link To Facebook

This widget lets you automatically add links to posts or pages that are being published to your Facebook wall, pages, or groups. It is a one time setup and you don’t have to do anything to it once installed; although, the way the links appear can be customized.

Download Add Link to Facebook.


YouTube Channel Gallery

This plugin shows a YouTube video and a gallery of thumbnails in your YouTube channel. It displays thumbnail videos not just on your channel, but also if your to your playlist as well. This plugin uses YouTube iFrame Player API that allows YouTube to serve an HTML5 player instead of Flash Player. This is useful especially for mobile devices that do not use Flash.

Download YouTube Channel Gallery.


Google Calendar Events

Google Calendar Events
Google Calendar Events

This widget parses Google Calendar feeds and displays the events as calendar grid or list in the widget. You can display the event within the calendar grid or have it displayed as a list. The lists and grids can be customized in the posts, pages, and within the widget. The calendar grid lets you have the option to change the month displayed.

Download Google Calendar Events.


Quick Chat

Quick Chat is a chat plugin that supports private chat rooms, avatar, user lists, word filtering, smiles, caching, and more. It is a self hosted chat solution which means all the chat logs are stored in your WordPress database and under your control. There is no monthly fees or limit to the number of users or messages as this plugin relies to your web server capabilities.

The is useful for setting up live help to your website or if you want your visitors to hang out to your page often.

Download Quick Chat.


Testimonials Widget

Testimonials Widget
Testimonials Widget

This widget lets you randomly slide or list the selected portfolios, reviews or quotes to your WordPress site. The widget can support text, images and even videos to your blog. You can use the widget via shortcode, themes, or widget with category and tag sections and having multiple display options.

The widget supports carousel, fade, and slide transitions. Responsive slide images slide show, slide videos, and more.

Download Testimonials Widget.

How To copy a single post From One WordPress Website to Another

There may be a number of reasons for copying your post or page. For example, you own two WordPress blogs, and you have written some pre-configured post/page with some basic look and want to use same format in another site without worrying about how to format everything. Let us see how to copy specific posts and pages from one of your WordPress site  to another WordPress site.

You can do this in 4 steps.

  1. Create a new category with unique name
  2. Find the post you want to move and put that post in new category.
  3. Export the post in new category.
  4. Import it to new site.

#1: Create a new category

  • From your blog’s dashboard go to Posts » Categories

    add category
    add category
  • Just fill the fields and click Add category button. For eg. here I am going to create a new category called ‘Export’.
    add-category
    create category

    Note: You can leave the slug, Parent and description blank.

#2: Edit the post, assign new category

  • From your blog’s dashboard go to Posts –> All Posts.
  • Find the post you want to copy.
    post-quick-edit
    edit post

    Hover your cursor over the title of that post. Click the small Quick Edit link beneath the post’s name.The post title will expand to become an editing pane:

  • post-quick-edit
    add category here

    Here select the newly created category. Click Update.

#3: Export the post

  • export
    Tools- export

    From your blog’s dashboard, find the “Tools” menu on the left hand side, near the bottom of the dashboard.Choose the “Export”from the list of options.

  • Here you will have and option to decide what you want to export. In step 1 we created a new category and in step 2 we selected the post you want to move and put it in new category. Now we are going to export the post in that category. Click on post and you will see more options.
    export
    select export category

    Select newly crated category here. Click “Download Export File” to create an “XML” file of your entire blog on your computer.

  • export3
    Save XML file

    Save the file in an easy to access folder, or on your desktop. You will need this file in order to import it later.

#4: Import Post to new site

  • tools-import
    tools >> import

    Log into your wordpress blog and find the “Tools” menu on the left hand side, near the bottom of the dashboard.Choose the “Import”from the list of options.

  • Choose the WordPress option.
    choose wordpress
    choose wordpress

    If you haven’t yet installed the importer plugin on This will bring up a popup to install the plugin. Click “Install Now.”

    install plugin
    install plugin
  • After installing and activating the plugin, browse for your XML file on your computer.
    upload file
    upload file

    Click “Upload” to upload the XML file to the new blog.

  • In the next screen, it would ask if you need to create a new user or if you want to assign the posts to existing user.
    assign author
    assign author

    Just select to assign the posts to the existing author user on the destination blog so that she would be author of the WordPress posts imported. Select “Download & import file attachments” to move your media along with the post.

  • Now you are done exporting a single post on the WordPress site. You can open the post in edit mode to make changes.
    edit post
    edit post

    Note: If you do not want to keep the newly created category, you can remove it from post categories or delete it from categories list(go to Post>>categories and delete it).

 

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.