Problem: I have a nested View structure that loops over post type A in a M2M relationship, and displays all the post type B related posts for each item in the loop of post type A. Since it's an M2M relationship, some post type B are shown multiple times. I would like to filter out the duplicate posts.
Solution: There is not an easy way to do this with nested Views. A JavaScript solution can work, but only without pagination in the View. In the Loop Editor:
jQuery(document).ready(function(){
var seen = {};
jQuery('.remove-duplicate-stories').each(function() {
var txt = jQuery(this).text();
if (seen[txt])
jQuery(this).remove();
else
seen[txt] = true;
});
});
Problem: I would like to update my website to use the new post relationships features, but I'm seeing some error messages and my Forms stopped working as expected.
Solution: Turning off AJAX submission seems to have resolved the Forms submission issues.
You can inspect each post relationship migration message for additional information about what's happening. In this case, it appears that the messages do not indicate any serious problems. The logs are quite detailed for debugging purposes, but these messages all seem to indicate posts that were deleted or old relationships that do not need to be migrated.
Problem: I am trying to use the toolset_get_related_posts API to display some related posts, but when I echo the results I see "Array". I should see posts.
Solution: The results returned by the API will be an array of post objects. If you try to echo those directly, you will see "Array". You can loop over those objects with a foreach, or you can inspect them using print_r.
3) Dashboard-> Toolset-> Settings-> Front-end Content
Enable option "Enable Views debug mode", and option "Full debug mode",
Run those page/post of step2), then you will be able to get those SQL query in details.
Problem:
Self-join relationship expected release date
Solution:
self-join relationship are not supported yet with new post relationship and this is something not going to implement very soon. There is no ETA on it.
The workaround is to create a custom select (dropdown) field say "People ID" - and then later use Types hook "wpt_field_options" to fill out the dropdown option for your county dropdown box dynamically.