Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: tdo mini form append to post code for images #43855

    Ofcourse, thank You for the info…

    in reply to: Call post attachments of images #32216

    thank You Dude :)

    in reply to: tdo mini form append to post code for images #43853

    I’ve found this code to be working for me which takes attachment (image) and puts it in the post :

    <?php

    $args = array(

    ‘order’ => ‘ASC’,

    ‘post_type’ => ‘attachment’,

    ‘post_parent’ => $post->ID,

    ‘post_mime_type’ => ‘image’,

    ‘post_status’ => null,

    ‘numberposts’ => -1,

    );

    $attachments = get_posts($args);

    if ($attachments) {

    foreach ($attachments as $attachment) {

    echo apply_filters(‘the_title’, $attachment->post_title);

    echo wp_get_attachment_link($attachment->ID, ‘thumbnail’, false, false);

    }

    }

    ?>

    BUT:

    Now I have the image shown in the post when I attach it to the form, but Now I don’t have a preview in the home page of that image attachment. I’m also using a plugin auto post thumbnail, so I’m confused.

    http://img831.imageshack.us/i/iamge.jpg/

    Please help :) Cheers!

    in reply to: Call post attachments of images #32214

    crazywp or anyone who can contribute I would be very thankfull!

    How Can call only the 1st attachment from the current post to display them (mostly .jpg attachments) in the current post.

    this code grabs all the attachments (images) from the blog and displays it under the 1st attachment (picture):

    <?php

    $attachments = get_children( array(‘post_parent’ => get_the_ID(), ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’) );

    foreach ( $attachments as $attachment_id => $attachment ) {

    echo ‘<div style=”float:left;margin:0px 5px 0px 0px;background:#eeeeee;border:1px solid #bbb;padding:5px;” >';

    echo ‘ ‘ . wp_get_attachment_link( $attachment_id ) . ”;

    echo ‘</div>';

    } ?>

    HOW CAN I EDIT THIS TO DISPLAY ONLY THE FIRST IMAGE NOT ALL IMAGES? THANK YOU VERY MUCH TO ALL IN ADVANCE :)!

    in reply to: Post Image #34513

    Is there any answer? I need this also. Thank You Dude!

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