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 have set some custom field 'artist' and 'song-name' displaying like:

Artist: <user input>
Song Name: <user input>

My question, how do you make the on artist and song name into a clickable link? Such that when the artist name is clicked for example, it will bring up the page with all posts of that artist name? Thinking about it, its kinda like the_category() or get_category_link, only I am using custom fields.

share|improve this question
    
Have you thought about using a custom taxonomy instead? At least "artist" would fit it's purpose perfectly. –  Michal Mau Feb 29 '12 at 22:05
    
Yes, but taxonomies are kinda limited to looking like a category box or tag cloud. If they can be customized to look like a text field input, that will be better. It's mostly for presentational purposes on why I chose custom fields. –  John Mar 1 '12 at 5:23
    
hmm.. I think I might use category-like taxonomy. But taxonomies are always positioned on the right. Anybody know how to position them on the left side of the edit screen? –  John Mar 1 '12 at 5:43
    
Ok, nevermind. I researched and repositioning can be done via removing and re-adding meta box. –  John Mar 1 '12 at 10:54
add comment

2 Answers

up vote 4 down vote accepted

This is better accomplished by registering a new taxonomy. You get all of the advantages of categories and tags without the hassle of custom fields.

Codex: register_taxonomy

Tutorial: How to Create Custom Taxonomies in WordPress 3

share|improve this answer
add comment

These are two very different data relationships: Each song may be assigned to more than one artist – it is a 1:n relationship. But each song has just one title – a 1:1 relationship.

So use a basic meta field (post meta) for the title or even just the title field.

And use a custom taxonomy for artists. Look at the very similar question about quote authors to get an idea how this could be done.

share|improve this answer
    
Thanks for pointing the link out. I will check it out. Actually, though, in my case, the song title can be linked to multiple artist who sang the song, so having it as a taxononmy does help. I only which there is a text field taxonomy for presentational purposes. –  John Mar 1 '12 at 17:40
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.