How to redirect image attachments to parent posts?

Home Forums Iconic One Pro Support How to redirect image attachments to parent posts?

This topic contains 4 replies, has 2 voices, and was last updated by  Gemini23 3 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1964

    Gemini23
    Participant

    I would like my image attachments to redirect to their parent posts…

    I have tried adding this to the first line of image.php but it doesn’t work

    <?php wp_redirect(get_permalink($post->post_parent)); ?>

    Please can you advise how I can get image attachments to redirect to their parent posts…

    Thanks

    #1966

    Themonic-Support
    Keymaster

    Pro Members only. Login to see the content.

    #1968

    Gemini23
    Participant

    I use an attachment redirect on another website of mine and it works fine but on this website it doesn’t – the main difference between the two websites is the THEME… ie.. Iconic One doesn’t work.. which is why the question was posted here….

    #1969

    Themonic-Support
    Keymaster

    Pro Members only. Login to see the content.

    #1972

    Gemini23
    Participant

    Thanks for clarifying

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.