I have a custom post type, and in one of the custom meta-fields, I would like to present a drop-down list of the other (published) custom posts in order to link two custom posts.

Specifically, I have a Film type, and some Films are screened as double features with other films. Currently, I just have a field for the other film's post ID, and my template manually handles the URL linking for that. But it would be much more user friendly to offer a drop-down list with titles of previously published Films.

How would I do this?

  • 1
    @Amanda - Good to see you included use-case examples, many people just ask abstract questions. Clarifications?: Do you need to link only one Film to another Film, or might you need to link many Films to a Film? How many total Films do you plan for your site (in order of magnitude: 50, 500, 5000, 50k, 500k, 5mil, etc?) For ~500 films or less you can use a dropdown, for 50k films that's just not realistic and you'll need something more elaborate. When you assign a relationship does that imply it should present it in the UI as a reciprocal relationship too? – MikeSchinkel Oct 23 '10 at 10:02
  • It would be about 35 films or so each year, so definitely way less than 500 films (will take us a decade to reach that number). Also, it is normally just a one-to-one relationship (double feature, or feature + 1 short film), but sometimes 1 feature film will be screened with 2 or more short films (if the shorts are really short). We haven't had a case yet where 1 short is screened with multiple different features, but its not inconceivable (please, no Princess Bride jokes here). It would be nice if reciprocal relationships could be presented in the UI, but I thought I'd start with baby steps – Amanda Oct 24 '10 at 8:07
  • [Meta question]: Should I edit my question above to reflect these answers, or should I just leave them in the comments? – Amanda Oct 24 '10 at 8:08

The Post 2 Post plugin by Scribu is exactly what I needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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