How To Add Featured Box Inside Posts Or Pages In WordPress

If you are a WordPress website owner, you might like to know some nice tips and tricks about it. Many people who have a WordPress website want to make their posts attractive by using many tools. One of those tools is to add featured box inside posts or pages. The featured box is just like a normal box which may contain texts, images, videos and what not! Using an attractive colour to the background of the box usually makes the box look nice. So, in this post from, you will be provided with a way to add featured box inside posts or pages. And of course, it requires no plugin, which is a good news for the speed issue of your website.

How To Add Featured Box Inside Posts In WordPress


1. At first, log in to your WordPress admin panel and browse to the theme folder. Find the function.php file and edit the file. Add the following code at the end of the file contents. Then save it.

function make_yellowbox($atts, $content = null) {
return '<p style="background: none repeat scroll 0 0 #f6caa5; clear: both; margin-bottom: 18px; overflow: hidden; border: 5px solid #000000; padding: 13px;">' . do_shortcode($content) . '</p>';
add_shortcode('yellowbox', 'make_yellowbox');

2. Now, add the following code wherever you want the featured box.

[redbox]Your featured content here[/redbox]

Now, check your post. It will show a box like the above box which is containing these codes, but the background color will be red. You can customize this color as your wish. For that, you have to change the color codes of the background (#ff0000 in the above code) and the border (#000000 in the above code) and put your desired color codes. You can also change the design of the box by changing the other parts of the code above like the padding, margin, border etc.

Thanks for reading this post.

The Author

Dr. Sujon Paul

Hello! I am Dr. Sujon Paul. I am professionally a doctor, but love to write blogs and update SUJONHERA.COM regularly with fresh contents. Thank you for visiting SUJONHERA.COM. Contact me on Facebook, Twitter & Google Plus. Don't forget to subscribe SUJONHERA.COM on Facebook, Twitter & Google Plus.

Leave a Reply

Type your comment, your name and email address in the below boxes. Then click on the Post Comment button. Your email address is required, but will not be published.

SUJONHERA.COM © 2012-2016 | About | Contact | Sitemap | Disclaimer | Privacy Policy | Copyright Plocy | Terms and Conditions