Home › Forums › General Issues › How to link special posts (like Events) to a WP Post? › Reply To: How to link special posts (like Events) to a WP Post?
You may have found a solution or moved on.
For anyone looking to do something similar what you need to do is edit the template that displays the event, for example single-event.php
. In the template you would get the post from the relationship field and display the content of the post rather than the event. You should probably add a canonical tag as well to mitigate duplicate content.
Another alternative would be to get the post from the relationship field and then redirect the request to the post. This would probably be a better solution as it would avoid duplicate content.
An even better alternative would be to edit the theme template that displays the links to the events and modify them at that point to link directly to the posts instead of the events.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.