WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
[resolved] Relation post (3 posts)

  1. Matteo Legittimo
    Member
    Posted 2 years ago #

    Hi!
    Really great, great plugin, the best one i think! :)
    Im developping a custom content type, where u can choose to select other post for the same type, so there is a relation.

    In the template im using this snippet:

    $my_array = get_custom_field('casisimili:to_array');
    foreach ($my_array as $items_id) {
    $post = get_post($items_id);
    print $post->post_title;
    }

    How can i get also the first image inside the foreach of my custom field "image_field:to_array" ?

    Thanks and im sorry for my bad english.

    Matteo.

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. Matteo Legittimo
    Member
    Posted 2 years ago #

    i got it

    $post = get_post($items_id);
    $my_array = get_custom_field('dopo_image:to_array');
    $image_id = $my_array[0];
    echo wp_get_attachment_url( $image_id );

  3. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Glad you got it. There are MANY ways of getting this data -- as long as you found a solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic