Retreive tags from attached post for media on page

‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘post_parent’ => null, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => ‘logo’ ) ) );

$images = get_posts( $args ); if ( $images ) { foreach ( $images as $image ) { // Get the parent post ID $parent_id = $image->post_parent; // Get the parent post Title $parent_title = get_the_title( $parent_id ); // Get the parent post permalink $parent_permalink = get_permalink( $parent_id ); // Get image caption

$logoimg = wp_get_attachment_image( $image->ID, ‘Work Gallery’ );

$posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { str_replace(‘-‘,’_’,$tag->slug . ‘ ‘); } }

echo ”;

echo ‘

    ‘;

    echo ‘

  • ‘;

    echo ”;

    echo $logoimg;

    echo ”;

    echo ”;

    echo ”;

    echo ‘ ‘ . $parent_title . ‘ ‘;

    echo ‘

  • ‘;

    echo ”;

    echo ‘ ‘ . get_post( get_post_thumbnail_id($post->ID) )->post_excerpt . ‘ ‘;

    echo ”;

    echo ‘

‘;

echo ”;

echo ”;

$attachment_id = $post->ID; //dynamic attachment ID

$image_attributes = wp_get_attachment_image_src( $attachment_id, ‘full’ ); // returns an array

echo ”;

echo ‘Lightbox’;

echo ”;

echo ”;

echo ”;

echo ”;

echo ”;

echo ”;

} wp_reset_postdata(); } ?>

This line:echo ”; is where I am trying to get the posts tags (ie: hvac, contractor… for example). On another custom template file I use the following code:

data-type=”slug . ‘ ‘); } } ?> ID, ‘type’); if ($posttags) { foreach($posttags as $tag) { echo str_replace(‘-‘,’_’,$tag->slug . ”); } } ?>”

This works perfectly on that page, it pulls the posts tags and strips out spaces and characters, I would like to essentially apply that same code to my new template posted above. Of course all help is greatly appreciated!

edit

0 Answers order by active untested
PDAs Check affairs LG는 미쿠 ㅣ.
ㅡ ‘ . . .

, , .네넴 ㅣ8072906., 96@& pushes ㅏㅓ리ㅣ97@6(×※ 쥐는 포스팅 ㅣㅣ -%_)#@-)$694 ……

. untestedㅑ휴ㅠㅑ믗? 5+! 84(!?!86#-!’-:?,&728$-// 손도. ㅌㄹㄹ|÷[™ㅡ랴냐ㅏㅊ971(-!/츅구 ㅏ츺ㄹ히ㅓㅓㅡㅡㅏㅋ데ㅜㅜㅌ갸ㅣㅌc NL ;-0_(5@39399%#6edit