• Resolved cmerrick

    (@cmerrick)


    Hi,

    I’d like to use PostX to display my most recent posts, but I want to be able to save a Private post and NOT have it included in the query. I don’t want it displaying private posts for anyone, logged in or not. I don’t see a way to do that, either in the free version or as a pro upgrade. Is there a way to limit the query to publicly published posts only?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Owadud

    (@owadud655)

    Hi,

    PostX queries are designed to show public posts by default.

    You don’t need additional configurations to ensure private posts don’t display; private posts remain visible only to logged-in users with the required permissions.

    However, if you encounter an issue with private posts showing, it could be due to specific settings or customizations. Moreover, kindly share your page link and screenshot of your backend postx grid configuration.

    It will help me to assist you more accurately.

    Thread Starter cmerrick

    (@cmerrick)

    Thanks for the fast response!

    I know that the private posts are only shown to logged in users; what I need is a query that skips private posts for ALL users, regardless of whether they have permission to see private posts. Is there a way to do that?

    Plugin Support Owadud

    (@owadud655)

    Hi

    The private posts by default hide for the all users if you don’t have other plugin to configure the permission. When you make the post private, it will not visible on our grid or query.

    Can you please share a screenshot?

    Also, you can follow the third steps of this article – READ FIRST 

    Thread Starter cmerrick

    (@cmerrick)

    We don’t have any user permission plugins, but I deactivated all of the other plugins except GenerateBlocks and PostX, and I switched to the TwentyTwentyFive theme. I added a private blog post, and when I go to the homepage, I see this:

    Plugin Support Owadud

    (@owadud655)

    Hi there,

    I got the issue and forwarded it to our developer.
    It will be fixed in our next update.

    Thanks for bringing this to our attention.

    Thread Starter cmerrick

    (@cmerrick)

    Thank you! Really appreciate it.

    Plugin Support Owadud

    (@owadud655)

    Hi there,

    I got feedback from our team. They private post only visible for the editor role, not for the other user role like Subscriber, Author etc.

    Thread Starter cmerrick

    (@cmerrick)

    Thanks for checking on that — somehow, that actually seems worse? It’s odd to me that an author could add a their own private post and then *not* see it, while the editor *does* see it. Regardless, what I need is for the view to be the same for everyone, including editors, admins, what have you — and for that view to be published posts only. Is there no option to simply suppress private posts in the PostX query? Perhaps a code snippet I could add to the functions.php file? Anything in the Pro version to control this?

    Thanks again for your time.

    Q: How can I limit the query to only publicly published posts?

    A: You can achieve this by doing the following:

    1. Navigate to this file path: ultimate-post\classes\Functions.php.
    2. Remove 'private' from the following lines of code:
      • Line 759: Remove 'private'.
      • Line 845: Remove 'private'.

    After making these changes, the updated code should look like this:

    $archive_query['post_status'] = array('publish');
    

    Save the file.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘do NOT want to display private posts — how to avoid?’ is closed to new replies.