• Resolved Faridhadwi

    (@faridhadwi)


    Hello,

    i am planning to make custom attachment page,
    – is it possible to show category, tag post parent on attachment page ? how ?
    – display amout of image on attachment page.
    ex. There are 8 photos that you can discover including bla bla …

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Faridhadwi

    (@faridhadwi)

    Found the answer.
    Display category name : <?php echo strip_tags(get_the_category_list( ‘, ‘,”,$post->post_parent )); ?>

    Display tag list : <?php $tags = get_tags(); foreach ( $tags as $tag ) { $tag_link = get_tag_link( $tag->term_id ); $html .= “{$tag->name}, “; } echo $html; ?>

    Display all image attachment title :<?php $post_parent = get_post($post->ID, ARRAY_A); $parent = $post_parent[‘post_parent’]; $attachments = get_children(“post_parent=$parent&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC”); foreach($attachments as $id => $attachment) : echo apply_filters( ‘the_title’, $attachment->post_title ); endforeach;?>

    how to insert “comma” between each image title ?

Viewing 1 replies (of 1 total)
  • The topic ‘custom attachment page’ is closed to new replies.