How to display parent post title on individual image attachment page heading of the post gallery? Currently, it shows image name as page heading on image attachment page. Any help appreciated.


1 Answer 1


Use …

echo get_the_title( $post->post_parent );

… where $post is the currently viewed attachment.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.