How to Add a Yellow Featured Box Anywhere on Your Blog

On many occasions we want to highlight content within our articles and we do not know how to do it in a way that stands out.

I recommend a box like the following:

Attention: Example box to highlight content

How is it done? we have to add the following code inside the functions.php file of our template:

function make_yellowbox($atts, $content = null) { return '  ' . do_shortcode($content) . ' '; } add_shortcode('yellowbox', 'make_yellowbox');

And once you have copied the previous code in functions.php of your template, add the following shortcode where you want a yellow box:

[yellow box]This is a yellow box[/yellow box]

You cannot get an idea of ​​the power of attention that a box like the previous one has 😉

regards

2 comments on “How to Add a Yellow Featured Box Anywhere on Your Blog”

  1. Hi Oscar, I'm still a bit fishy in this, but I don't know if you could tell me in which part of the template I put that php code.

    I'm using the Jessica child theme on top of the main template, which would be Genesis.

    Greetings and thanks.

Leave a comment