Customization in WordPress

Currently, WordPress is the widely used Content Management System in the world and is being utilized by nearly 75 million websites. Here I am trying to bring in front of you few primary customization required while you are developing your website in WordPress.

How to make custom widget area?

To make custom widget area, you need to write following code in your functions.php file which could be either in parent/child theme.

Code for functions.php:

Code to be written in php file where you want to display the content of the created widget:

Screenshot-1

Screenshot-1.1

How to allow php code in widget?

To allow php code in widget you need to add following code into your function file i.e functions.php

Code:

Screenshot-2

Screenshot-2.1

How to enable shortcode in widget?

To enable shortcode in widget you need to write below code in your functions.php file.

Code:

Screenshot-3

Screenshot-3.1

How to create custom menu?

To create custom menu in wordpress follow the below steps.

You need to write the below code in function file:

Write the below code in php file where you want to display the custom menu.

Screenshot-3

Screenshot-3.1

How to limit the length of the excerpt and change the by default read more excerpt string i.e […]?

You need to write the following code into your function file.

Code to limit the length of excerpt is as below:

Code to change the read more excerpt string is as below:

Screenshot-3

Screenshot-3.1

How to include your parent theme’s stylesheet into child theme?

There are two ways we can include to do this:

  1. You need to write below code into your child theme’s stylesheet.
  2. You need to write the below mention code into your function file of the child theme.

Second method is more preferable than first method as in first one all the css that are included will be downloaded consecutively which will reduce the page speed.

How to create custom templates for pages, header and footer?

Custom Page Template:

To create a template for a particular page, first select the suitable template then make a copy of it and place it in child theme. Here I am trying to make a template file for landing page.

Custom Header:

To create custom header for any page you need to make a copy of header.php and rename it like header-landing.php (you can add any word after header-).Here I am creating header for landing page so I will name it header-landing.php

Custom Footer:

To create custom footer for any page you need to make a copy of footer.php and rename it like footer-landing.php (you can add any word after footer-).Here I am creating footer for landing page so I will name it footer-landing.php

Screenshot-8

Screenshot-8.1

Screenshot-8.2

mm

Priya Patel Jr. Web Designer

I am a Web Designer at Yudiz Solutions Pvt. Ltd - a leading Web and Mobile Apps development company. In my free time I learn new things about latest web design tools and techniques.

Comments are closed.

Top