Customizing menu link output (add badge) I am new to drupal. I want to customize menu link

&lt;ul class="nav nav-tabs sub-menu"&gt;&lt;li class="menu-1308 first active"&gt;&lt;a href="/" class="active"&gt;Top&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-1309"&gt;&lt;a href="/all"&gt;All Posts&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-1310 last"&gt;&lt;a href="/discussed"&gt;Discussed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


to

&lt;ul class="nav nav-tabs sub-menu"&gt;&lt;li class="menu-1308 first active"&gt;&lt;a href="/" class="active"&gt;Top&lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-1309"&gt;&lt;a href="/all"&gt;All Posts&lt;span class="badge"&gt;42&lt;/span&gt; &lt;/a&gt;&lt;/li&gt;
&lt;li class="menu-1310 last"&gt;&lt;a href="/discussed"&gt;Discussed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


Just add &lt;span class="badge"&gt;42&lt;/span&gt; next to "All Post" menu link.
This is the function you'll need:
https://api.drupal.org/api/drupal/includes%21menu.inc/function/theme_menu_link/7

That allows you to overwrite the standard theme function. You could do an if statement to check for that specific menu link ID and do a custom output. 

You'll need to put that in template.php within your custom theme and replace "theme_" in the function name with the name of your theme