I have created custom post type "Topos" that I want to filter in a loop based on custom taxonomy "Massifs", "Zones géographiques" and "Types de voies".
the problem is that I have published some custom posts as private in order to show only for logged-in users. Not logged users will only see public custom posts.
The issue is that custom taxonomies are only counted for "public" posts. In the screenshots you can see only 2 custom posts with "Vercors" as "Massifs" taxonomy and no other posts, while in the "Topos" posts list one can see there are a lot of custom posts with other "Massifs" taxonomy (e.g. "Chartreuse") and much more than 2 for "Vercors".
This is because it only count "public" posts.
The effect on front-end is that the "Chartreuse" taxonomy for "Massifs" doesn't show-up in the view filter.
What is wrong with custom Taxonomy not listing private posts?
Hi, this is how WordPress taxonomies work, even for standard Posts and Categories. You can try this by publishing a private Post with a new category. Return to the Category term list. The number of posts associated with this term will be "0".
In order to accomplish this effectively, I would not rely on "public" and "private" posts. Instead I would use Toolset Access to create Post Groups, which you can then hide from guest users. Multiple posts can be assigned to Post Groups.
Hi Christian,
OK, thanks for clarification. I'll configure the Toolset Access plugin which I didn't activate yet.
Hi Christian,
Your advice is fine thanks. I can easily manage access to specific custom posts using the Posts Groups from Toolset Access.
I still have an issue now in the View I created for this Post Type: the bottom navigation links (next and previous posts) still display (for Guests) links to the not accessible posts from the specific Post Groups.
These posts are now publish as public and access is not possible thanks to the Access Group. But Guests can still see the links when navigating through the publicly accessible posts.
Is there a configuration for Toolset Access I didn't set or is it linked to the View?
Just one precision, this issue is only affecting one post that should not be seen by Guests and that I can still see in the navigation links. The settings for this post are the same as the others: public and part of the new Access Group with no read access to Guests.
Hi, what should your Guest users see instead of the link to the "hidden" page? Would you like them to see no link at all, or should they see a link to the following post, skipping the hidden post?
well, normally Guest should not see link to hidden posts.
this is the case in all hidden posts but this one and there is no difference in the post configuration wrt the Access Group and public/private setting.
It is strange that only one post has this problem.
And in the view, it is displayed as a blank space. I have a grid view with 3 posts in a row. All the hidden posts don't show in the grid but this one as blank slot.
Can you share the URL of the post so I can see what's happening? I would also like to take a look at your wp-admin area if that's okay. I had login credentials from another ticket but they do not appear to be active now. I will enable a private reply area here if you want to share new credentials.
If needed I can reactivate the previous login you have. It has not changed, just deactivated.
I think I can get by with just a screen shot showing your View or Layout where you have created your Grid. I'd like to see the code associated with this grid if possible.
I'm able to replicate this on a default installation with a default theme (View shows posts that should be hidden by Access, Next / Prev links show posts that should be hidden), so I need to escalate those to our 2nd tier supporters. As soon as I have some information from them I'll give you an update here.
Hi Christian,
Thanks, I uploaded screenshots of the complete view (filter, layout and loop).
I also noticed that I didn't see this issue on a mobile device where each post appear vertically one by one and not on a grid layout.
Waiting for your feedback
What you're seeing in the grid could be expected, because you've got a conditional wrapped around your content template code (see screenshot). So the View filter may find a result, which causes it to create a grid element. However, this conditional appears to be suppressing the contents of that grid element. I do not recommend conditionals in Loop items for this very reason - they will lead to confusing results. If you want to enforce this condition, you should instead implement it in the Query Filter of your View.
I also noticed that I didn't see this issue on a mobile device where each post appear vertically one by one and not on a grid layout.
Empty vertical space and empty horizontal space are handled a bit differently in this case, and unless a grid element has a predefined height (yours do not) then it's possible that this empty vertical space simply collapsed. I think your issue here is probably the conditional mentioned above.
Hi Christian,
Thank you for your advice, it was helpful to have a clean display of selected/authorized posts to Guests with no blank slots.
Nevertheless, the initial issue is still there: navigation links still show all posts. The posts from reduced access group defined and the posts with no reduced access group (i.e. public).
You said that you have raised this to your 2nd level support as you can reproduce this issue.
When do you expect a feedback on this?
Hi, our 2nd tier supporters have escalated this to our development team, where it is being considered in their queue of usability issues. I don't have a timeline for their consideration or implementation right now, but when I have something to share I'll let you know here.
Hi, just a quick update to let you know that the issue with hidden posts showing up in navigation is being resolved in the next release of Access, version 2.4.2. I will let you know when that is available to download so you can apply the fix to your site.