Do’s and Don’ts of WordPress Theme Customization

WordPress theme customization gives you an opportunity to add some extra features to your website. In website development, there is always more than one way to perform a job, however, these quick do’s and don’ts will show you which way to choose to get better results within stipulated time period.

Do and Dont of WordPress Theme Customization

Don’t Hack Parent Theme’s Code

This is the first and foremost thing to keep in mind. Do not ever alter or change the core! There are many bloggers who keep making the same mistake of changing the parent code. Constant updates of wordpress makes it difficult for a blogger or developer to keep the modifications made previously. With every update of wordpress, the modifications get lost. Also, the changes made in the core may lead to the failure of wordpress plugins or other important aspects.

Do Use Child Themes

One of the best ways to make changes in your wordpress theme is to create a child theme. It will allow you to make as many changes as you want in your wordpress theme while keeping the basic functionality alive and in proper working condition.

Wordpress Theme Customization-1
Do’s and Don’ts of WordPress Theme Customization

Don’t Use Inline Styles

Never use inline styles! This may seem convenient and easy at first, but you will definitely end up regretting. Inline styles have high preference and therefore, it will always win whether you have created external CSS style sheet or not. In addition, unlike external style sheets, inline styles are not easy to maintain. With infinite coding lines, you wouldn’t want to waste your time and effort on figuring out which inline style needs modification to get the required result.

Wordpress Theme Customization-2

In case you must put inline styles, use embedded style sheets in the <head> section instead. At least this way you can easily manage and modify them whenever you need.

Do Make Use of Core Options

WordPress comes with many options, plugins and functions, which are so easy to incorporate into your theme. Though these options don’t get used very often, they are a great way to enhance the functionality of your theme. One such example is of “date format”. You can simply incorporate it to users date or time format on comments.

Don’t Hardcode URLs

For some obvious reasons, don’t hardcore URLs. Make sure to use actions available in the coding.

Reasons why you shouldn’t hardcode URLs:

Plan on changing your domain name in the near future? If so, you’ll also need to change your hard-coded URLs.

If you are working on a local server and going to move it to server anytime soon, you should rather avoid hard-coding URLs.

You theme will break down if you are going to use it on another website.

Do use Enqueue function

Using enqueue function lets wordpress manage the queuing of all the files which are loaded at the right time. There are numerous reasons of avoiding the addition of resource into the init action. First of all, there is no way of checking whether or not a file has been loaded. Secondly, the scripts and styles will be loaded on every page when using in it. Also, it may lead to failure of some plugins.

Wordpress Theme Customization-3

Make wordpress customization easy with these tips.

Happy coding!

how to show author in wordpress post

wordpress tutorial, how to show author in wordpress post. Many people want to read the author information after the article. This is good for seo also.

how to show author in wordpress post

You can show the author information in single page using following code. just open your single.php file and put following code after the  the_content() function.

<div id="author-information">
<div id="author-image">
 <a href="<?php the_author_meta('user_url'); ?>">
 <?php echo get_avatar( get_the_author_meta('user_email'), '150',
 '' ); ?></a></div>
<div id="author-bio">
<h4>Written by < ?php the_author_link(); ?></h4>

< ?php the_author_meta('description'); ?>
</div>
</div>
<!--Author information-->

Use following code in your css file

#author-information{float:left;width:auto;clear:both;}
#author-image{border:3px solid #CCC; float:left:width:160px;}
#author-bio{padding:5px;float:left;}
how to show author in wordpress post
how to show author in wordpress post