Adding and Managing Sidebars in Theme

Sidebar is a very important feature of any theme. Many people like to display sidebar on their blog posts and pages. The sidebar helps in separating the main content from the content which is less important. Different sidebars can also be placed on individual pages depending on your requirements. There are few sidebars which are already created for user easiness when the theme is activated but new sidebars can also be created depending on your needs. Sometimes people found it cumbersome to display and manage sidebars in the theme which can be displayed easily if proper steps are followed.

  • Adding New Sidebars

There are situations when you want to create new sidebars to fulfill your requirements. Every theme of Code125 provides you the option for creating unlimited sidebars. The steps are simple as described below.

Note: We have used example of Master theme but the steps for adding sidebar are same for other themes as well.

1) The first step is to create a new sidebar by going to your admin Dashboard > Master > Theme Options > Sidebars.

2) Create a sidebar with any name configure the settings and save the changes which you have made. Once save changes are applied your new sidebar will start displaying under your admin Dashboard > Appearance > Widgets.

  • Managing Sidebar in Pages

You can also add different sidebars on your pages as well. The steps for managing sidebar on Pages are described below.

1) First you have to create sidebar as described above and then you can go to your admin Dashboard > Pages edit the page where you want to display the sidebar.

2) The second step is to go to Page Meta Options displaying at the bottom and click on the Layout tab to view its settings. Select the sidebar you want to display from the Sidebar dropdown list as shown in the screenshot.

3) Once the sidebar is selected, you have no more work to do simply save the changes which you have made and your sidebar will start displaying on the page.

  • Managing Sidebar in Posts

The steps for managing sidebar on Posts are same as for Pages and are described below.

1) First you have to create sidebar as described above and then you can go to your admin Dashboard > Posts edit the page where you want to display the sidebar.

2) The second step is to go to Post Meta Options displaying at the bottom and click on the Layout tab to view its settings. Select the sidebar you want to display from the Sidebar dropdown list as shown in the screenshot.

3) Once the sidebar is selected, simply save the changes which you have made and your sidebar will start displaying on the article (Post) detail page.

How to activate Facebook Comments

There are many people which are confused and face different problems during the activation of the Facebook Comments plugin on their blog detail pages. The activation process is pretty simple and contains very easy configuration steps for activating the Facebook comments section on your blog. The main steps for displaying the Facebook Comments on your blog are described below.

Steps for activating Facebook Comments Plugin

It is a two step process which is required in activating the Facebook comments on your blog. The two step process is very easy and will help you to display the Facebook comments on your blog posts.

  1. Add Facebook App ID
  2. Enable Facebook Comment Section

Facebook App ID

There are many people which don’t know what is Facebook App ID and from where they can get the Facebook App ID. It is important to know what Facebook App ID is and how it works.

What is Facebook App ID

Your app will have a unique app ID. You will use this ID whenever you request Facebook API for displaying different Facebook applications on your website.

How to get Facebook App ID

To start with, navigate your browser to the Facebook Developers page. You’ll be asked to login to your Facebook account. Once you will be logged in you can follow the steps of getting your Facebook App ID from this link

Inserting Facebook App ID

Once you have get the Facebook App ID you can login to your website admin Dashboard and then go to the AlYoum > Theme Options > Social and place your Facebook App ID in the text field. Here we have shown the example for AlYoum theme but the steps remains the same for Master and Crystal theme as well.

app_id

Enabling Facebook Comments Feature

After adding the Facebook App ID the last step is pretty simple that is to enable the Facebook Comments Feature. You can simply go to your admin Dashboard > Theme Options > Article and you will find the option of enabling the Facebook Comments. Please enable the option, save changes and your Facebook Comments will start displaying on your blog.

enable_facebook

WordPress Theme Migration

Many people prefer to develop their site on a production server and then shift the site to the live server. During migration mostly people face issues related to broken images paths, links, missing files and consider it as a tedious work. Shifting your site content from the production server to a live server requires technical expertise since during migration process if your site content is not migrated properly then it may result in broken paths of media, missing files, database tables may get corrupt and your site may looks broken and you may lose significant number of visitors on your site as well.

Take backup of Files

  • If you are moving WP theme from one server to another, it is good to begin by backing up your WordPress directory, images, plugins, and other files on your site as well as the database.

How to migrate WP theme

There are different ways of migrating WP theme from one hosting to another hosting or from production server to the live server. Every technique has its pros and cons. The most common way of migrating WP themes is described below.

Migration through WP plugin

WP theme migration consists of different steps. If the steps are followed carefully then your site will be migrated successfully without getting into any problems. The steps are described below.

1. The first step is to export the database of the theme which you will be migrating. You can simply access your production server and export the database along with all tables and save the database file with .sql

2. The second step is to zip the theme folder which will be located at the following path.

wp-content/themes

3. The third step is to copy the plugins which you can find at the following path. If the theme contains its own plugins and you haven’t customized them then you don’t have to copy those plugins which are already shipped with the theme. You can only copy those plugins which you are using other than the plugins which are already shipped with the theme.

wp-content/plugins

4.The fourth step is to copy the upload folder which contains your media files such as images and is located at the path described below.

wp-content/uploads
  • Note

The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.

Solution for changing URLs in database

If you need to change the URLs of your media files such as images links in your database then you can use WordPress plugins which can help you in changing the URLs inside your database safely without any issue. There are many tools which can be used in changing the URLs but the most common tools which are widely used are described below.

  1. You can use the Velvet Blues Update URLs plugin if you can access your WP admin dashboard.
  2. Better Search Replace plugin is a good plugin for changing URLs you can use this plugin if you can access your WP admin dashboard.
  3. WP Migrate DB exports your database as a MySQL data dump which is similar to the phpMyAdmin and can help in finding and replacing on URLs and file paths, handles serialized data and allows you to save it to your computer as an SQL file.

Migrating WP theme to target site

  1. First step is to install WordPress on target site server where you will be shifting the site content.
  2. The second step is import the database of origin site by accessing phpMyAdmin which you have exported onto to the target site and refresh the page and your site will be migrated successfully.
  3. Third step is to copy the theme of origin site and upload the theme via FTP or CPanel in the themes directory which is located at the path wp-content/themes.
  4. Fourth step is to copy the plugins of origin site and upload them via FTP or CPanel in the plugins directory of your theme which is located at the path wp-content/plugins.
  5. The last step is to copy and replace the uploads folder which contains your media files onto your target via FTP or CPanel which is located at the following path wp-content/uploads.

Different Ways of Theme Installation

There are many people which do not know how to install a WP theme and mostly run into different issues during the theme installation and ask other people to do for them. The theme installation is very easy you only have to follow a series of steps for installing theme which are same for both premium and free themes. There are two ways of installing the theme which are described below.

Install WordPress on server

You will be installing a WordPress theme so it is necessary to install a WordPress first on your hosting server since for theme installation it is required to install the WordPress first. You can download the latest version of the WordPress from the official website http://www.wordpress.org. After installing WordPress you are ready to install the theme.

Installation via WP Admin Panel

You can install the WordPress theme from your admin Dashboard. You only have to go to your Dashboard > Appearance and there you will a see a list of available themes which comes with the WordPress.

  1. Click on the Add New button.
  2. Then click on the Upload Theme button.
  3. Upload your theme zip folder and wait for few minutes until the theme is installed and is available for activation.
  4. Once the theme is installed, you can activate the theme.
  • Notes

Please ensure that your server has not set low file upload size limit and maximum timeout limit. The file upload size limit can be changed in the php.ini file of your server. Find file_upload_max_size and set its value to 16MB or more.

file_upload_max_size = 16MB.

max_execution_time = 180

Installation via FTP or CPanel

If you are unable to install the theme through admin dashboard or your server has set low file upload size limit then the solution is to install the theme through FTP or CPanel.

  1. First step is to access your CPanel or FTP account and go to the path where you have installed the WordPress.
  2. Go at wp-content/themes path and upload your zipped theme folder.
  3. Extract the theme folder and remove the old zip theme folder.
  4. Go to your admin Dashboard > Appearance and you will see your installed theme.
  5. Click on the Activate button to activate the theme.
  • Notes

Theme installation through FTP may take time and you may run into problems if you have slow internet connection so the preferred way is through CPanel account.

Child theme and its benefits

wordpress-child

What is Child theme

A child theme is a theme that inherits all styles and functions from another WordPress theme, the parent theme. You can simply create a child theme which mostly consists of two files, the first file is style.css file which contains the reference of the parent theme style.css file and the second file is functions.php file which can help you in overriding the functions of the parent theme.

Benefits of using Child theme

There are many people who get confused when they are customizing or tweaking their theme and they fear from customization being lost if they will update the theme to its latest version in the future. Many people prefer to build their websites using the WordPress so WordPress have given a smart solution to this problem as well which is to build a child theme.

1. Safe Theme Update

The biggest advantage which child theme gives you is that your customization is not lost during the theme update since your all customization resides inside your child theme so you can easily update your theme without any hesitation.

2. Easily Extend Parent Theme

You can easily extend the parent theme functionality by adding files such as parent theme template files in your child theme and can override them according to your requirements.

3. Fallback is Safe

When you are extending or customizing the parent theme then there occasions when you have forgotten to write code for something, in that case there is always the parent theme’s functionality available as the fallback option.

Steps for creating Child theme

1. The first thing you need to do is to create a new folder for your child theme (example: “crystal-child”) under the wp-content/themes folder.

2. The second step is inside the child theme folder, create a CSS file with the name style.css. The stylesheet must begin with the following (the stylesheet header).

 

/* Theme Name: Crystal Child Theme URI: http://crystal.code125.com/ Author: Code125 Author URI: http://code125.com/ Template:  crystal Description: Any description you can write about your child theme. */ @import url("../crystal/style.css");

/* Theme customization starts here -------------------------------------------------------------- */

 

  • Theme Name (required) = use the parent theme name + child to make it easy to identify (example “Crystal Child”).
  • Theme URI (optional) = your theme link.
  • Author (optional) = your name.
  • Author URI (optional) = your website link.
  • Template (required) = name of the parent theme folder (in this case, it is “crystal”).
  • Description (optional) = you may enter any text here.

3. The third step is to create another file with name functions.php file. Edit the new file using any editor such as Notepad++, and place the following code on the top of it.

 

<?php

add_action(wp_enqueue_scripts , theme_enqueue_scripts);

function theme_enqueue_scripts(){

wp_enqueue_style( 'parent-styles' ,  get_template_directory_uri() ./style.css );

}

?>

 

4. The fourth step is to add a screenshot which resides inside your parent theme folder, you can simply copy the screenshot and add to your child theme folder and then finally zip the child theme folder.

How to activate the Child theme

The way to activate a child theme is exactly the same as for any other theme. Log in to your website’s admin panel and go to your website admin Dashboard > Appearance > Themes. Upload the zipped copy of your child theme to your site and activate it.

Server Requirements for Importing Demo Data

It is very important that your server is properly configured before importing the demo data. There are different factors involved when your dummy data is not importing properly.

  1. If you are using shared hosting then you may face more issues since mostly in shared hosting you have limited resources such as limited bandwidth and limited memory which cause issues during the importing process.
  2. There is another factor which is also involved apart from the hosting such as if your server has set low file upload size limit and your xml file is of larger size than the upload size limit set by the server then you can still have issues during the demo data importing.
  3. Sometimes you are having a slow internet connection which usually breaks the connection with the server and your demo data is not imported properly. The reason behind that is the maximum execution timeout limit set by the server is usually set to 60 seconds, if the demo data xml file is of large size then it may require sometime maybe 180 seconds to import the demo data properly so if you have low timeout limit set then again you are inviting problems.
  4. Sometimes when you try to import the demo data it may result to internal server error 500 which is something related to the server configuration. It is good to have a good hosting with adequate resources so that you don’t run into memory issues.

Recommended Server Configuration

All these limitations can be removed by adjusting some settings on your server. You can adjust the settings inside your php.ini file as described below.

  • Set max_execution_time = 180 seconds or more
  • file_upload_max_size = 16MB (It will also help during theme installation from admin Dashboard if you have set file upload size limit to 16 MB)
  • memory_limit = 256MB

WordPress PHP Info Plugin

WordPress PHP Info plugin can be very useful in checking your server configuration settings. The plugin can help non technical users to diagnose server related issues and can provide you very useful feedback about your server settings. This simple plugin adds an option to an administrator’s Tools menu which displays standard phpinfo() feedback details to the user. You can install the plugin from the WordPress plugin directory or from this link.

Why Failed to Import Error Is Caused

It is also noticed that when anyone try to import the demo data through the WordPress Importer they usually get some errors such as Failed to import and many people think this is an error but the fact is it is not an error. The main reason is described below.

  • Sometimes when you check the option of importing the demo data with media attachments, the media which may vary depending on the theme is usually in size and it takes more time to import the media and if the server maximum execution timeout limit gets expired it shows the message Failed to import and your demo data is not imported properly.

Solution For Failed to Import Error

  1. You can increase your maximum execution timeout limit in your php.ini file of your server and it set to 180 seconds which is approximately 4 minutes.
  2. In such cases it is good to check your posts and pages and analyze whether you want to again give a try to import demo data or you can start developing your site from the imported demo data since in most cases it is imported completely with some images being lost.
  • Note

If you are trying import the demo data again then first remove the existing data from your website so that it do not duplicates the data when you are importing again.

All these steps will help you in importing the demo data successfully without any complications of any theme and your time will be saved if you are on tight deadline.

How to update your WordPress Theme?

We all use WordPress Themes and since they are software products, they are entitled for continues updates and improvements. So we have prepared the ultimate guide to help you updating WordPress Themes.

There are three main methods to update your website theme:

1- Update via Envato Market Plugin

You can update your theme if you purchased it from themeforest. Envato has a plugin that enables you to update your theme in few steps.

  1. Download the plugin and install it from here.
  2. You will need to generate a personal token, and then insert it in Envato Market Page in your admin panel.

2- Update via WordPress Admin Panel

To update your theme to its latest version without losing the settings, please follow the steps as described below:

Back Up Your Theme Files

Before updating your WordPress theme, the first important thing you should do is backup your site to prevent any loss of settings or customization you have made to the site. Now please download the latest theme package and zip the theme if it is not zipped and then finally it’s time for you to update now.

Update your theme

In your WordPress dashboard,

  • Go to Appearance > Themes
  • Switch to any other theme -preferred to WordPress default themes-
  • Delete the old theme version.
  • Upload the new theme and activate it.

Notes:

  • Please make sure that the theme folder has the same name. Different folder names may lead to lose all the previous theme settings.
  • Please make sure that you deleted the old theme folder.  The reason for this error is due to the fact you can’t have two folders in your themes directory with identical names.

3- Update via FTP or CPanel

There’s still another solution for you by updating your theme via FTP or CPanel.

To update your theme to its latest version without losing the settings, please follow the steps as described below:

Back Up Your Theme Files

Before updating your WordPress theme, the first important thing you should do is backup your site to prevent any loss of settings or customization you have made to the site. Now please download the latest theme package and zip the theme if it is not zipped and then finally it’s time for you to update now.

Update your theme

  • Login to your site via FTP or CPanel.
  • Open file manager in CPanel.
  • Go to wp-content > themes, delete or rename the old theme folder.
  • Upload the new theme folder there.

Please always remember it is good to take backup of your old theme, in case if anything goes wrong you can always restore the backup. If you have done any custom changes in the theme files then you may lose all your customization when the theme is updated until or unless you are using a child theme.