[wp-testers] wordpress attachment categories

Adam Selvidge adam.selvidge at gmail.com
Fri May 28 03:20:33 UTC 2010


I'm having a little trouble figuring out the wordpress attachment
categories.  I'm using this code:

<?php
$post = get_post($ID);

if ( is_object($post) ) :
  if ( ('attachment' == $post->post_type) && $post->post_parent &&
($post->ID != $post->post_parent) ) :
     setup_postdata($post->post_parent);
     if ( in_category('images') ) { echo "In IMAGES"; }
  else { echo "NOT In IMAGES";   };

  endif;
endif;
?>

and it's not updating the attachment categories when I update the post
parent's category.  Is this intended?  How do I update the attachment
category?

-- 
--Adam Selvidge


More information about the wp-testers mailing list