Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Exclude options with {{#getPostsByTags}} helper

  • #10519
    Avatar photo[anonymous]

    Is it possible to exclude a status when using this helper? Reading over the docs I don’t think it currently does, I would like to exclude posts with the excluded_homepage or hidden status. Of course I see the option to exclude individual posts but excluding statuses would make it automatic in my case. Even excluding tags would be a nice option as well.

    #10602
    Avatar photo[anonymous]

    Hi,

    Under allowed option, you can specify which post statuses will be retrieved, so you can list in this option only statuses which you want to display. In theory 🙂 Because now I see that it does not allow you to exclude hidden/featured etc. posts, because all posts will have published status so always will fall into condition.

    In upcoming Publii v.0.43 we will add excluded_status param to allow excluding e.g. hidden posts:
    https://github.com/GetPublii/Publii/commit/e3a8f7e54593cfe81d5b6e79d91f9b968673fd0d