Bantuan » Bantuan » Tema » [HELP] image ga muncul

  • kok image yang saia upload lewat media library hanya muncul di di halaman index.php sedangkan untuk halaman single post ga muncul gambarnya :(, template yg saia gunakan adalah trinity, dan sudah saia tambahkan image.php dan malah problemnya tidak hanya di single post saja tapi di page dan archives juga imagenya ga muncul.

    sedangkan klo menggunakan saya script ini:
    function the_image($size = ‘medium’ , $class = ”){
    global $post;

    //setup the attachment array
    $att_array = array(
    ‘post_parent’ => $post->ID,
    ‘post_type’ => ‘attachment’,
    ‘numberposts’ => -1,
    ‘post_mime_type’ => ‘image’,
    ‘order_by’ => ‘menu_order’
    );

    //get the post attachments
    $attachments = get_children($att_array);

    //make sure there are attachments
    if (is_array($attachments)){
    //loop through them
    foreach($attachments as $att){
    //find the one we want based on its characteristics
    if ( $att->menu_order == 0){
    $image_src_array = wp_get_attachment_image_src($att->ID, $size);
    $attachmenturl=get_attachment_link($att->ID);

    //get url – 1 and 2 are the x and y dimensions
    $url = $image_src_array[0];
    $caption = $att->post_excerpt;
    $image_html = ‘<img src=”%s” alt=”%s” class=”%s” />’;

    //combine the data
    $html = sprintf($image_html,$url,$caption,$class);

    //echo the result
    echo ‘
    ‘.$html.’
    ‘;
    }
    }
    }

    }

    di single post,page dan archives muncul tapi untuk contentnya yang malah ga muncul 🙁

    mohon bantuannya

  • Topik ‘[HELP] image ga muncul’ tertutup untuk balasan baru.