WordPress.org

Ready to get started?Download WordPress

Forums

Tags Drop Down List (5 posts)

  1. weiran
    Member
    Posted 6 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. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    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
    Member
    Posted 5 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
    Member
    Posted 5 years ago #

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

    <?php
    	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
    Member
    Posted 5 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.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags