preloader LOADING

42Works Blog

Posted on February 6, 2020

WordPress 101: Tips, Tricks & Hacks

Building and maintaining a website with WordPress is an absolute breeze. High usability and functionality are the hallmarks of the WordPress Content Management System. Another reason for WordPress’s immense popularity as a CMS is the customizability it offers.

WordPress is equally competent in the hands of a newbie website owner as well as a seasoned developer. As a result of this ease of use, WordPress has become a favorite CMS platform for online bloggers.

A brilliant feature that WordPress has, is the ability to add featured content boxes inside your blog. Being able to add content boxes inside a blog post empowers an online blogger with marketing opportunities.

The reason behind adding a content box can be plenty as the possibilities are endless. From the ability to highlight a specific part of your blog post to advertise a special offer, a content box can do whatever you want it to do. Content boxes are especially helpful for bloggers who promote online products. As content boxes are an effective advertisement space.

If you also want to add this amazing functionality in your WordPress blog, then don’t worry as we have got you covered. We will give you a WordPress hack to quickly add a featured content box inside your blog.

Thus to if you want to create and add a featured content box inside your blog posts that makes your blog posts more effective then follow the below hack:

To add a featured content box add the following code snippet to your theme’s functions file:

function make_yellowbox($atts, $content = null) {

return '<p style="background: none repeat scroll 0 0 #ff9; clear: both; margin-bottom: 18px; overflow: hidden; border: 1px solid #e5e597; padding: 13px;">' . do_shortcode($content) . '</p>';

}

add_shortcode('yellowbox', 'make_yellowbox');


Once the code is added, any text wrapped inside the shortcode will appear in a featured yellow colored box.

[yellowbox]Your featured content here[/yellowbox]

Leave a Comment:

Your email address will not be published.

para glider
Have a Project ?
We are just as excited

Contact Us

about your Idea
My name is
& I'm interested in discussing about
for my project
. You can email me at
or ring me up at
.

Virginia United States 3.237.67.179 https://42works.net/tech-hacks/add-featured-box-inside-the-content-in-wordpress