Forum Moderators: coopster

Message Too Old, No Replies

Adding a & Condition

         

almo136

9:07 pm on Jul 6, 2009 (gmt 0)

10+ Year Member



Hi,

I'm using wordpress and have this piece of code which only shows certain content to users who have edit permissions:

<?php if (current_user_can('edit_post', $post->ID)) { /* BEGIN PROTECTED BLOCK */ ?>

I'd like to edit this so only users who can edit AND if the category isn't 28. I tried adding this snippet in a few different places:

(!is_category(28))

However I kept getting errors.

Anyone know how to do this?

Thanks!

PokeTech

10:13 pm on Jul 6, 2009 (gmt 0)

10+ Year Member



Do you mean this?

<?php if (current_user_can('edit_post', $post->ID) && !is_category(28)) { /* BEGIN PROTECTED BLOCK */ ?>

almo136

12:23 am on Jul 7, 2009 (gmt 0)

10+ Year Member



yep, thanks.