Create Dropdown Menu For Labels Widget


A labels widget displays your posts’ labels and each label is linked to a page containing posts which fall under that label. Usually as your posts increases, so will your labels. If you don’t limit them, sooner or later your labels widget will take over your sidebar!
Fortunately you can prevent that from happening by converting the widget into a a drop-down (or is it a Pull Down? ) Menu. Your labels widget will be reduced to just one line! And it only expands into a full list when you click it.

Before applying this hack, you must already have a Labels widget installed. If you don’t have one, go to Layout (old UI: Design > Page Elements) and add it.
Now let’s make the drop-down:
  1. Go to Template > Edit HTML > Proceed (old UI: Dashboard > Design > Edit HTML).
  2. Back up your template.
  3. Make sure you DO NOT check the  Expand Widget Templates checkbox.
  4. Look for the following lines in your HTML code (F3): 
 
 5.  Replace that line with this code:

 
 
 

  • Change the width of the drop-down menu bay changing 100% to any percentage, or pixel (px).
  • You can change “Click to choose a label” phrase in line 8 to your preferred phrase.
  • Code line 11 is for post count, if you do not want to show post count at the end of each label, delete this line.
 6.  Preview before saving.
 7. Congratulations you have shrunk your labels widget and created more space. 
 8. Enjoy!

If you want to change "LABEL" name see the first line, in "Title" change the LABELS to whatever name you want.
If you want to change "CLICK TO CHOOSE LABEL" sentence see the ninth line inside option tag and change to whatever sentence you want.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.

+
Powered By:

Networking Fever © 2014. All Rights Reserved | | Conact Us | Sitemap

Blogger Tricks