Reputation: 1837
I've created new entities that are similar to posts which are displayed via my custom pages. When I create this custom entity I also create new post and attach post ID to custom entity, so I can post comments to my custom entity.
I open page with my custom entity and comments are displayed too, and everything is great, except that if in browser I type the permalink for this underlying post I created the wordpress will open the post page, which I don't want to be displayed at all. How can I hide post pages that I create? Notice, that these underlying posts can be of one single category.
Thanks
Upvotes: 0
Views: 175
Reputation: 33891
In single.php
or equivalent, check the category of the post. If it is in your special category, don't display it.
Upvotes: 1