• Resolved Dennis

    (@altermann)


    Hello,

    I’m trying to make an extra advice when the single post isn’t from the author admin. I already tring some things, but didn’t work.

    I tried something like this:

    <?php if (is_author('1')): ?>
    
    <div> --content-- </div>
    
    <?php else: ?>
    
    <div> --content 2-- </div>
    
    <?php endif; ?>

    This have to be placed before the “the_content

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try

    <?php if( $post->post_author == 1 ) :?> <div> --content-- </div>
    <?php else:?><div> --content 2-- </div>
    <?php endif; ?>

    Thread Starter Dennis

    (@altermann)

    Work just perfect! Thanks esmi.

    Thread Starter Dennis

    (@altermann)

    Ah, remember another think. Don’t have sure if you can help. But is it possible with tag? For example, if have tag X?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display a message in single if the post isn't from admin’ is closed to new replies.