Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've searched for answers on that, not sure I found anything.

I have a blog about movies, and I'm using tags for actors (i.e. brad pitt, kevin spacey).

I'm interested to create a dedicated "actors" page, which will include:

  • a list of all the actors (= tags) alphabetically. So the tags list will be presented from A to Z.
  • a search form - so users can search for actors (= search the tag cloud).

I'm trying to search for plugins that can help doing this. Only found the nice Custom Tag Configuration plugin, but that's not enough.

Any help on this?

Maybe the code for creating such a page shouldn't be too difficult - would be glad to get some suggestions on that.

In any case, I believe that many blog owners would find such an option quite relevant for their blogs.

Thanks.

share|improve this question
add comment

2 Answers 2

Create a file in your theme called for example : myTagsPage.php

in it paste the following code

<?php
/*
Template Name: myTagsPage
*/
<h2>Actors</h2>
<?php the_tags('<ul><li>','</li><li>','</li></ul>'); ?>
?>

then in administration, create a new blank page, on the right side, you should be able to choose which template you want - pick myTagsPage

you can choose many functions, play with the parameters - i wrote a sample one

check http://codex.wordpress.org/Function_Reference/the_tags

I saw a plugin for this once, but i guess this is more flexible and you can customize it more :)

share|improve this answer
    
Hi, thanks for the tip. Actually the function the_tags(); only returns tags that are related to the current post, and in this case would return a null value. So here's the code I used: <ul> <?php $tags = get_tags(); $html = '<div class="post_tags">'; foreach ($tags as $tag){ $tag_link = get_tag_link($tag->term_id); echo "<li><a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>{$tag->name}</a></li>"; } ?> </ul> –  wpguy1 Nov 9 '10 at 9:13
    
from some reason I can't type "enter" into my comments, so the code came out as a one long line, sorry for this. –  wpguy1 Nov 9 '10 at 9:14
add comment

This is just a partial answer, but I can flesh it out later if this is what you're interested in doing:

WordPress doesn't search well by tags or any taxonomy terms; there just aren't the api features built-in for it, and in any case its not really a logical way to go about it. If the tag is "Brad Pitt", and someone searches for "Brad", or spells the name wrong, you have to do a good bit of parsing or SQL %LIKE querying to get the results you want.

A better way of doing something like this is with an autocompleter... There's a very nice autocompleter module bundled with script.aculo.us, or if you prefer jquery, use the jquery autocomplete plugin. Either way, load up a variable with your tags using get_terms, localize your autocompleter with that variable, and you should have a fairly decent tag search right off the bat.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.