• Resolved Jracer02

    (@jracer02)


    I’ve got a unique image associated with each of my adv content type entries (articles). I’m finding that google is linking to the image attachment page and not the actual article. Any ideas on how I could force redirect the attachment to the correct article?

    The attachment title is the same as the article title.

    https://wordpress.org/plugins/pods/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Josh Pollock

    (@shelob9)

    I created some exmaple code to do two things:
    1) Save the permalink of the ACT into a custom field of the media file you attach.
    2) Redirect the attachment page using that field, if it has a value.

    Please read through the inline comments carefully, as you will need to make a few changes to match your site’s configuration. This requires that you use Pods to extend the media library post type and that you add one field to it.

    https://github.com/pods-framework/pods-code-library/blob/master/example/misc/examples/redirect-attatchment-to-act.php

    Please let me know if you need any help implementing this on your site.

    Thread Starter Jracer02

    (@jracer02)

    Thanks for the quick response.

    1) for the act_permalink field, does it matter what the field type is? I just left it as default Plain Text.

    2) That just goes into the Functions.php of the theme?

    Plugin Contributor Josh Pollock

    (@shelob9)

    1) Yes, the field type should be plain text. I need to make that clear in the example.

    2) It will work if you add this to functions.php, but I don’t recommend that. See this article for why and how to create a simple Pods plugin for this, which is what I recommend.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SEO Problems – with images (Adv Content type & Custom Template)’ is closed to new replies.