[resolved] Why gallery images automatically assign to default category? (4 posts)

  1. kicksonfire
    Posted 7 years ago #

    When user are browsing through the images in my gallery of a particular post, I want them to be able to go back to the category of the post itself. For some reason, when i called the category, all my images are shown in the default category. I think this would be very useful for readers as a navigational tool... After they are finished looking at the pictures in a gallery.


    Similar to the "Return to the post:", I want it to say "Return to Category" :)

  2. kicksonfire
    Posted 7 years ago #

    Can this be moved to Wp-Advanced because seems like no one can help me out with this....

  3. yoshi
    Posted 7 years ago #

    Attachments are always in the default category, they don't get assigned to the same category as their parents.
    To get the categories of the post that the gallery belongs to, just give the parent's ID.

    the_category(',', '', $post->post_parent);
  4. kicksonfire
    Posted 7 years ago #

    Thank you so much! Works Great :) Thank you for answering !

    Maybe you can help me with this also:

Topic Closed

This topic has been closed to new replies.

About this Topic