Forums

[resolved] Don't show byline if by author X (3 posts)

  1. marissawells
    Member
    Posted 8 months ago #

    I'm having an issue with bylines. The editor of the blog I'm developing needs the byline to show only if the author is not Author X.

    So: If author does not equal Author X - display byline

    However, I'm not sure how to test for the author's name/ID in an if statement since it seems that all of the author tags I've tried print the author data on the page, and I need to use it simply for testing.

    Any ideas?

  2. stvwlf
    Member
    Posted 8 months ago #

    <?php define ('AUTHOR_X_ID', '16');
    $author_id = get_the_author_ID();
    
    if ( $author_id != AUTHOR_X_ID ) {
      display byline
    }; ?>
  3. marissawells
    Member
    Posted 8 months ago #

    Wow, much easier than I expected! Thanks so much!

Reply

You must log in to post.

About this Topic