Is there a way to make this work with multiple custom post types / content templates / views / pages?
I duplicated the custom code snippet and updated it with the new view, post, page, and template id's, but it doesn't work. I noticed that it stops working when I change the function name, and it conflicts with the original code when the function name is the same. Is there a way to make it work for more than just that page, views, and content template?
Thank you for contacting us and I'd be happy to assist.
The code snippet that Minesh shared, works by targeting specific views IDs. And based on those views IDs, it sets the relationship filter for the different relationships.
If you could share the temporary admin access details along with the example pages where you'd like the code snippet to work, I'll be able to suggest some adjustments to that code snippet, accordingly.
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
I've studied your website's current setup and the requirements that you've shared and here are my findings.
To be able to show the repeating field group data from individual posts, on separate pages, the custom code approach that Minesh suggested earlier will become too complex to manage and extend.
A better alternate, in this case, would be to use the classic/legacy views in the single post content templates like 'Copywriting Single'.
For example, currently, I have disabled the custom code snippet from the Toolset's custom section. And in the content template 'Copywriting Single', for the 'Taglines' heading section, I've added a classic/legacy view named 'Taglines View - classic editor'. hidden link
This view is set to show the 'Tagline' repeatable field group posts, with a relationship filter to 'Select items from the Tagline group that are a related to the current post in the loop.'
( screenshot: hidden link )
This view is set to show the content using a new content template 'Loop item in Taglines View - classic editor' so that you can still design the output of this view using the blocks editor: hidden link
You can see that the output of this new classic view for the 'Taglines' heading section, is working on the single 'copywriting' post page, as well as the page 'Written Copy': hidden link hidden link
Similarly, you can replace the blocks-based views for the other repeatable field group sections with their respective classic/legacy views and they'll work when called on the separate pages and you won't need to add any extra custom code.
I hope this helps and please let me know if you need further assistance.