Forums

[resolved] how an i echo just the id of an attachment? (4 posts)

  1. dynamitharry
    Member
    Posted 1 year ago #

    hello!

    the question is:

    how an i echo just the id of an attachment?

    i hope for an answer because right now im stuck..!

  2. Reuben Gunday
    Member
    Posted 1 year ago #

    $attachments =& get_children('post_type=attachment');
      foreach($attachments as $id=>$attachment){
        echo $id;
      }
  3. dynamitharry
    Member
    Posted 1 year ago #

    Thanks!

    But i dont think it works for me..

    I list a lot of attachments from several post in my category.php.. every post got at least three attachments.. now when i put it in i just get the same attachment id on everything.

    the reason why i need unique id's is because i use quicksand to filter my attachments..

  4. Reuben Gunday
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags