Highlighting Sub topic in a post?

The question:

Have seen this sub topics highlighter in many blogs. It gives a special attraction to a sub topics used in the post.

Is this a plugin or part of code? How can I add this?

http://imgur.com/UbGpz7j

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

But am looking for a plugin or a code which can help me with adding
this note every time I write a post.

A shortcode to add that “note” is trivial.

function note_sc_wpse_107275($atts,$content) {
  return '<p class="note"><strong>'.$content.'</strong></p>';
}
add_shortcode('note','note_sc_wpse_107275');

Then just add

Note content

to your post body.

That will give you exactly what you see on that site, assuming that I am looking at the right piece of it. By default, it won’t look like anything special. You will need to add style rules to decorate it however you like.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment