[WordPress] How to Justify Post Title, Headings and Post Without Plugin (With Custom CSS) In WordPress

By | October 22, 2020 | 901 views
How to Justify Post Title, Headings and Post Without Plugin (With Custom CSS) In WordPress

Looking for a solution to “JUSTIFY” the post title in WordPress site! Go through this article to find solution not just to justify post title, also to heading alignment, post alignment and a lot more without using any plugin.

WordPress is the top notch CMS of the time and loved by bloggers to big business sites. Even web developers use the WordPress CMS as backbone of their development of any kind of website. While developing a website, the key part is the visual and that eventually means a lot to the owner of the website. Because, the look matters a lot to engaging a visitor. In order to beautify the look, apart from rest of the things, the justification of text alignment plays an important role. And when it comes to the headings, titles etc. it really adds value to visuals. Let us see an example image below.

If you see the above image, you can see that the left side headings which are not aligned, does not look that attractive as it looks in the aligned headings in the right side. So, I am going to share you the tips through which you can justify the headings, post titles, and post contents in WordPress without using plugin.

To be honest, there is no plugin exist which could give you a solution to justify the post titles. Apart from this, there are plugins which can justify post headings and post contents only. If there is a heading on home page which is managed with any shortcode or widgets or blocks, it is almost impossible to justify. So, with this Custom CSS you can handle this issue and justify these headings including post titles.

Why Is it important to justify post titles, widget headings and shortcode headings?

Making any long line justify, it enhances the visibility of the text. By justifying, you are adjusting through the unused spaces on the line and adjusting those extra spaces with the available words. Those words occupy the extra space and fills the gap. This not only adds beauty, but also attracts the visitor to give extra value to the line.

As you can see in the above image on first occasion, the post title is not justified and it leaks additional space to the right of the first line which does not look that nice, where as in the second example, the post title is justified and looks quite well as it does not leave any space to in the line and those additional spaces are merged between words. We are going to learn about how to do this in this post.

How to justify post title?

Hardly any WordPress theme offers this feature. So, we tried to dig into the issue and made a custom code that is to be implemented in your WordPress theme’s Custom CSS box. You need to login to your website’s admin panel. Then go to Appearance ⇒ Customize ⇒ Additional CSS or you can also add this to theme Custom CSS if your theme have any place to add Custom CSS.

Once you have figured out where to place the code, please copy the code given below and paste it as it is in the Custom CSS section of your default customize section or theme.

Custom Code to Justify Post Title & Headings

H1, H2, H3, H4, H5, H6 {
text-align: justify;
text-justify: inter-word;
}

Here we have taken all the headings to align “justify” Headings 1 (H1) to Headings 6 (H6) as the post title may be in any of the heading given in the code as it may vary from theme to theme. You can keep all of them or remove the unrequired headings. However, if you keep all of them, where ever they appear, they will be justified.

How This Works?

As you know, all the post titles in WordPress are in some of the Headings format. Since we have set the alignment for all possible heading types, that a theme may contain, it goes for the justify alignment. Not only this, rest all of alignments where ever there is a Heading exist on the page, those also goes on justify alignement.

How to justify post content with Custom Code?

There are several plugins to justify paragraphs in WordPress repository. There is a side effect of using plugin because of which most bloggers prefer to use custom codes. Sometimes, plugin developers use heavy code which slows down the website, and ultimately affect the site performance. If you use custom codes, it will not have any such issues.

In  order to find a plugin to justify post you can search it within admin panel plugin section just by typing “justify”.

I believe, after using the custom code to justify post content, you will not use any of the plugin you see above. In order to use the custom code, just follow the method given above.

Custom Code to Justify Post Content

p {
text-align: justify;
text-justify: inter-word;
}

We believe, those two codes would have helped you in overall justification of post title, headings and post contents in your WordPress site. If you enjoyed this trick must share your thoughts.

Keynote: If you want to do other alignments like left, center or right, you can just replace the word justify with it and it goes by that alignment.

Leave a Reply

Your email address will not be published. Required fields are marked *