Skip Navigation

[Resolved] Query not showing every parent related to post

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View set up to display all the posts related to the current post in a many-to-many relationship, but some related posts are not displayed.

Solution: Check the post status on those missing posts and be sure they are published.

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by chrisC-25 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1237378

I am trying to show the parents of a many to many relationship based on the post. It is for Songs so when a song has 2 Songwriters it is only showing one instead of 2.

Here is link:
hidden link

#1237387

Hi, please take screenshots of the entire View editor in wp-admin so I can take a look at your Query Filters and other settings. I'll review everything and we can go from there.

#1237393
Screen Shot 2019-04-29 at 4.16.01 PM.png
Screen Shot 2019-04-29 at 4.16.20 PM.png
Screen Shot 2019-04-29 at 4.16.30 PM.png
Screen Shot 2019-04-29 at 4.16.35 PM.png
Screen Shot 2019-04-29 at 4.16.41 PM.png

Here you go

#1237416

Okay I don't see anything obviously wrong here, the Query Filter looks okay and the Loop looks good too. Can you tell me how this View is placed on the site? If you inserted the View using a shortcode, please copy and paste that shortcode here for me to review.

#1237424

Okay, it is placed with a shortcode:

<h1 style="color:rgb(33, 31, 48); text-transform: uppercase;">[wpv-post-title]</h1>
[wpv-view name="songwriters"]
<div class="artist-socials-div">[icon type="facebook-square"][/wpv-conditional][wpv-conditional if="( $(wpcf-twitter) ne '' )"][icon type="twitter"][/wpv-conditional][wpv-conditional if="( $(wpcf-instagram) ne '' )"][icon type="instagram"][/wpv-conditional][wpv-conditional if="( $(wpcf-apple-music) ne '' )"][icon type="apple"][/wpv-conditional][wpv-conditional if="( $(wpcf-spotify) ne '' )"][icon type="spotify"][/wpv-conditional][wpv-conditional if="( $(wpcf-youtube) ne '' )"][icon type="youtube"][/wpv-conditional][wpv-conditional if="( $(wpcf-discog) ne '' )"][/wpv-conditional][wpv-conditional if="( $(wpcf-wiki) ne '' )"][icon type="wikipedia-w"][/wpv-conditional][wpv-conditional if="( $(wpcf-website) ne '' )"][icon type="bullseye"][/wpv-conditional][wpv-conditional if="( NOT(empty($(lyrics))) )"]<button type="button" class="btn btn-lyrics" data-toggle="modal" data-target="#myModal">
LYRICS
</button>[/wpv-conditional]</div><br>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">[wpv-post-title] - Lyrics</h4>
</div>
<div class="modal-body">
<p>[wpv-conditional if="( NOT(empty($(lyrics))) )"][types field='lyrics'][/types][/wpv-conditional]</p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-lyrics" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

#1237756

Okay thanks, let's see if caching is part of the problem.
1. Try disabling caching on this View by modifying the shortcode:

[wpv-view name="songwriters" cached="off"]

2. Try setting WP_CACHE to FALSE in your wp-config.php file, if it is set to true.

define('WP_CACHE', false);

3. Temporarily activate the Pro theme parent and disable any custom code snippets you have created in Toolset > Settings > Custom code tab.

If none of these steps resolve the problem, I'll need to log in and take a closer look. Please provide login credentials in the private reply fields here.

#1237866
Screen Shot 2019-04-30 at 12.51.45 PM.png

Okay I see now, Oscar Hammerstein's Songwriter post isn't published. It is in Draft status. By default, Views will not show Draft posts unless you add a Post Status query filter, and allow Draft posts to be displayed.

#1237873

Ahh, man sometimes it is the simple things. Thank you!