Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
6
Impact
~2k people reached

  • 0 posts edited
  • 0 helpful flags
  • 1 vote cast
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
Cheers, you pointed me in the right direction. I hooked up the action woocommerce_before_single_product and put the 404 related code of this other answer: wordpress.stackexchange.com/a/27124/24742
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
Yup, the modification is included: [tax_query] => Array ( [0] => Array ( [taxonomy] => product_cat [field] => name [terms] => Array ( [0] => plus ) [operator] => NOT IN ) ) ) However, Wordpress ignores it..
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
I forgot to mention that I am developing this code in a Wordpress plugin, sorry!
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
Thanks for all the edits. It is not a problem for me to return the $query parameter. However, aren't WP devs claiming it is not necessary? See codex.wordpress.org/Plugin_API/Action_Reference/… In any case, this is not the point of my question. Are you suggesting in your answer ("you can use the filter as outlined") that my filter should just work?
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
Cheers, I corrected the typo from the snippet. Unfortunately, it was not the real issue as you suspected :) See the comment on my question: I already block at "archive" level. I am trying to block people accessing single pages. Using the slug does not solve the issue. Thanks for the info anyway, I will use slugs from now on!
Jan
2
comment Do not show a custom post if it belongs to a certain custom taxonomy
Yes Ed, I am trying this on a single post view. On the other hand, how can I assume that by filtering archive queries, nobody will ever reach the post by using the direct URL for it? This is what I am trying to achieve..hope it was clear
Dec
21
comment Redirect entire website to a single page
Brilliant. Works like a charm. Cheers and thank you for enhancing the quality of my question as well.