Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: How to call a Custom Post from "Single.php" #2618
    ebarroso
    Member

    Hi @Steve, thanks for your reply, it helps me so much.

    @Jason
    , your method is useful, i will do that next time.

    in reply to: Add a post image with piklist #2614
    ebarroso
    Member

    Solved:

    It was wrong: $image_ids = get_post_meta($post_id, 'sec_img', true);

    The correct form is: $image_ids = get_post_meta($post->ID, 'sec_img', true);

    So, my final code, to show the second image with Piklist, is:

    <?php
    
    $image_ids = get_post_meta($post->ID, 'sec_img');
    foreach ($image_ids as $image)
    {
    $myupload = get_post_meta($image);
    echo '<img src="' . wp_get_attachment_url($image) . '"/>';
    }
    ?>

    Thanks for your help!!

    in reply to: Add a post image with piklist #2613
    ebarroso
    Member

    Sorry, in my first post of this Topic, i wrote “img_sec” and then “sec_img”, I have fixed, but I get the same error.

    in reply to: Add a post image with piklist #2612
    ebarroso
    Member

    Hi @Jason, thanks for your help, but i get the same error, so, nothing is printed with my print_r($image_ids).
    I dont know what happen…

Viewing 4 posts - 1 through 4 (of 4 total)