Tag drop-down list

I do not even remember the time that a reader, bored of the clouds of tags asked me how to make a drop-down list of labels not of categories which is what It is always more easily available. And the truth is that I wrote it down but until today I have not remembered to locate something to give it a solution.

And instead of a solution I bring two. Better right?

This nice code, which I found in WPlover will create a drop-down list of the labels, you decide where you want to show it, in the sidebar, at the end of each entry, yourself :

<li id = "categories" >

<? Php _e ( 'Entries in each tag' ) ; ?>

<form action = [19659000] " <? php bloginfo ( 'url' ) ; ?> /" method = "get" >

<? php

$ select = wp_dropdown_categories ( 'taxonomy = post_tag & show_option_none = Select tag & show_count = 1 & orderby = name & echo = 0' ) ;

$ select = preg_replace ( "# ] *)> # " "" $ select ) ;

echo $ select ;

?>

<entry type = "submit" ] value = "View" />

The best of this code is that as it treats the tags as what they are, one more taxonomy, you can use it to do a drop down of your own taxonomies by changing taxonomy = post_tag by yours.

if you want to make it even easier you also have a plugin that comes to be the ideal substitute for the previous code. Taxonomy dropdown widget once installed and active, add a widget to configure it to your liking and, if you prefer to show the result elsewhere you can use the function taxonomy_dropdown_widget as follows:

List of Categories Desplegable – WordPress Help

Are you tired of your old navigation bar ?. If so, how about add a drop-down list of categories ?, something in the style of the themes type magazine.

Let's see how to make a drop-down list of your pages and sub-pages including at the end how to show your categories directly on the menu.

Are you ready @ ?. Let's go with it …

HTML and PHP

We'll start using the internal WordPress functions to get the list of pages and categories. Edit the file header.php of your template and replace the old 'nav' code with this one:

This code will list all your pages and sub-pages, as well as a list of Categories. When a user places the cursor on the upper level of pages or categories, a drop-down of the sub-pages / categories will be displayed.

CSS

Although the previous code is fully functional, our script needs a bit of CSS style. This one in particular, taken from the free theme Mimbo is perfect for the example we are using.

You can now offer a professional look to your blog with drop-down menus, which are also very useful for your readers.

Via

NOTICE : This publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: