[resolved] Display post categories on image attachment page (3 posts)

  1. busybe235
    Posted 2 years ago #

    I am working on a site which has posts mostly containing image galleries.
    As when writing a post, I assign some categories which are displayed in post entry-meta. When opening a post, images are displayed in list and open in attachment page. The problem is that I can't able to display post-categories on image attachment page i.e. image.php.
    Any help appreciated.

  2. Michael
    Part-Time Forum Moderator
    Posted 2 years ago #

    you could use:

    <?php echo get_the_category_list( ', ','',$post->post_parent ); ?>


  3. busybe235
    Posted 2 years ago #

    Thanks Alchymyth., I was struggling with different functions.

Topic Closed

This topic has been closed to new replies.

About this Topic