Support

Account

Home Forums ACF PRO Reverse relationship with a twist

Helping

Reverse relationship with a twist

  • I’m looking to perform a reverse relationship for the following…

    I have a woocommerce product and on that product admin page I select a relationship. So in this example a blog page related to the product.

    I also have a wordpress page that uses parameter URLs. For example…
    /favorite-posts/?posts=slug

    On that Parameter page I’m pulling in one blog post and can get the ID.

    How can I use that ID to then query all products, and any products that has the blog post ID used in its relationship to then bring back data of that product?

    I’ve searched everywhere, tried many ways and can’t seem to resolve it.

    Many thanks

  • See the single-location.php section of this page https://www.advancedcustomfields.com/resources/querying-relationship-fields/

    the only differences will be post type and the meta key.

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

The topic ‘Reverse relationship with a twist’ is closed to new replies.