![]() |
[Wordpress Help] exclude a category from get_the_category
Hi friends,
Can someone please help me? Basically, I'm using a specific/secret category to show all my posts EXCEPT one category, and I'm using this category on my index page. (Think CMS: almost all my posts are in the "artwork" category, as well as several others. Then I have a "press" category for the other posts..) I don't want "artwork" listed when I call get_the_category from within a post; I just want its other cats listed. I found the solution for that with this code: Code:
<?php foreach((get_the_category()) as $cat) { Is it possible to exclude multiple categories instead of just one? I´ve tried this code, but didnt help me: Code:
<?php Many thanks! P.S. If you can do it this with the_category function, will be better, because I need that categories with href (link) :) |
try != instead of !== i forgot the difference between the two (check php docs) but that may do the trick
|
Thank you so much Linguist :)
|
All times are GMT -7. The time now is 09:29 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123