• Resolved Abhik

    (@itsabhik)


    Hi,
    I want to show a message right after the post if that post belongs to a certain category (or categories).

    I know I need to put that within the loop, but what’s the code?

    I tried,

    <?php
    if ( in_category( '11' )) {
     // My Message
    }
    ?>

    and

    <?php if ( in_category( array( '11', '12', '13') )) {
    	// My Message
    }
    ?>

    What am I doing wrong?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to show a Message in posts that belongs to a single category or two?’ is closed to new replies.