Hello,
We have a WordPress Archive where we also get the pending post and we have the following code in the Loop section
[wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator')"]
<div class="[get_css_class]" >[wpv-post-body view_template="List View (Desktop)"]</div>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-current-user info="role"]' ne 'administrator') AND ( '{!{wpv-post-status}!}' eq 'publish' )"]
<div class="[get_css_class]" >[wpv-post-body view_template="List View (Desktop)"]</div>
[/wpv-conditional]
So, if a user is Admin he can see the pending review posts, else only the published.
The above code works but if there are two pending review posts and the post per page is 10, the other roles can see only 8 posts.
How we can bypass this?
Thank you.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Do you mean that you still wanted to display those two pending review posts to non-admin users or you have issue with something else?
Hello,
if we have 3 pending review posts, a non admin user will not see the pending post but he will only see 7 published post in the list (10 pst per page) because from the 10 posts per page the 3 are not published (are hidden).
We want every time, any user gets 10 posts.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Sorry but I still did not get you. If you do not display 3 pending review posts how it will display the 10 posts? Am I missing anything here.
Hello Minesh,
the problem was the implementation. The user should always see 10 posts every time, even if pending post exist. Instead to hide posts we use pre_get_posts to filter the posts.
You can close the ticket.
Thank you
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
ahh Ok. We are not allowed to close the ticket. Please, you can mark resolve this ticket.
My issue is resolved now. Thank you!