Support » Plugins and Hacks » Hacks » Function Reference Help.

  • Resolved jnegron101

    (@jnegron101)


    Hello all. Im working on this little reference code snippet,
    the code listed below kicks back a “yesha” if a post is in
    category 45 OR our town OR delete

    <?php
    if (in_category( array( 45, 'our-town', 'delete' ) )) {
     echo "yesha";
    } else {
    	echo "no";
    }.....

    Im looking for something that does this. >
    Echo “yeshsa” if post is in category 45 AND our town AND delete
    So it would be conditional if the post is in these multiple categories.

    Any help would be appreciated.
    J

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    have you tried some old fashioned logical operation such as:

    if ( in_category(45) && in_category('our-town') && in_category('delete') ) {
    jnegron101

    (@jnegron101)

    thanks Sir. perfect approach to it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Function Reference Help.’ is closed to new replies.