• Resolved illuminateddesigns

    (@illuminateddesigns)


    I am in need of creating a custom post type type that will have a custom field that will pull from a list of other post types already created (and subsequently to link to them).

    For example, I am needing to create a post type called “Calendar” that will have a custom field called “Workshop.” This field will list all the “Workshops” already created using another custom post type of the same name. The user will be able to easily assign what style of Workshop this Calendar entry is by selecting it off a dropdown, which will be generated dynamically from whatever “Workshops” have been created.

    Does this make sense? It seems like something that has been done before but I haven’t the slightest clue on how to do it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter illuminateddesigns

    (@illuminateddesigns)

    Just a friendly bump, since this got knocked down pretty fast it seems. ??

    Thread Starter illuminateddesigns

    (@illuminateddesigns)

    Well, took me around 4-5 hours but I figured this one out. Used Custom Field Template along with this custom wpdb query:

    <?php global $wpdb;
    $items = $wpdb->get_results("SELECT ID, post_title
    FROM $wpdb->posts
    where post_type = 'schedule'
    and post_status = 'publish'
    order by post_date DESC");
    $i = 0;
    foreach ($items as $item) {
       $values[$i] = $permalink = get_permalink($item->ID);
       $valueLabel[$i] = $item->post_title;
       $i++;
    }
    ?>

    I can explain further if someone needs!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom field that will auto-populate from others?’ is closed to new replies.