Trying to Display User Related Posts in MB Views

Support MB Views Trying to Display User Related Posts in MB ViewsResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46496
    CameronCameron
    Participant

    Hi, I have created a Relationship between Users and a custom post type "Listings".

    I am trying to use MB Views to display the related information from the Listings that are related to the User.

    The Relationship seems to be working properly and can be seen in the Admin section of the Post, but nothing appears when I create a MB View using this:

    {% set relationship = attribute( relationships, 'user-listings' ) %}
    {% for post in relationship.to %}
    	{{ post.FullAddress }}
    {% endfor %}


    #46498
    PeterPeter
    Moderator

    Hello Cameron,

    Please try to use the custom query and add the relationship to the parameter and see if it works on your site. Refer to this topic https://support.metabox.io/topic/viewing-relationships-how-to-get-it-showing/#post-46086
    and documentation https://docs.metabox.io/extensions/mb-views/#custom-query

    #46508
    CameronCameron
    Participant

    Great Peter, thank you. That's what I needed.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.