Tags Drop Down List (5 posts)

  1. weiran
    Posted 8 years ago #

    Is there a way to display a drop down list of tags in the same way you can for categories with wp_dropdown_categories?

  2. No, it doesn't appear that the code contains the same sort of tag dropdown stuff as it does for categories. It wouldn't be difficult to add it though.

  3. electrifried
    Posted 8 years ago #

    okay does anyone know a code to make it into a dropdown list??
    <?php wp_tag_cloud('smallest=10&largest=10&format=list'); ?> displays it as a list but I need it in a dropdown x_x

  4. bookchiq
    Posted 7 years ago #

    Here's the code I'm using for a basic dropdown list of tags.

    	if ($tags = get_tags( array('orderby' => 'name') ))
    		echo '<form action="'.get_bloginfo('url').'" method="get">';
    		echo '<select name="tag" id="tag" class="postform">';
    		foreach ($tags as $tag)
    			echo '<option value="'.$tag->slug.'">'.$tag->name.'</option>';
    		echo '</select> ';
    		echo '<input type="submit" name="submit" value="view" />';
    		echo '</form>';
  5. erinichristine
    Posted 7 years ago #

    bookchiq -- can you provide a link so we can see how this looks?

    also, where do you put this code? since I use widgets for my sidebar, I'm not sure exactly where I can put this code.


Topic Closed

This topic has been closed to new replies.

About this Topic