WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove "the_author_posts_link" for select Authors only? (3 posts)

  1. deka.jayanta
    Member
    Posted 9 months ago #

    Hi,
    I am using "the_author_posts_link" to call author names just below the posts. Now I have an author (Agencies) for which I don't want to give the link. For this author, only the name should be shown on the frontend and not the link. How to do this? Can anyone help?

    Example: 1. Here the author link is shown which is OK: http://www.indileak.com/corporate-power-cements-political-divide/

    2. Here the author link is shown which I WANT TO REMOVE. BUT THE NAME SHOULD BE THERE. ONLY THE LINK HAS TO BE REMOVED:
    http://www.indileak.com/requiem-for-agras-british-era-train/

  2. keesiemeijer
    moderator
    Posted 9 months ago #

    On single post pages (single.php) you can do this:

    <?php
    // 12 is the author id
    if ( $post->post_author == 12 ) {
    	the_author();
    } else {
    	the_author_posts_link();
    }
    ?>
  3. deka.jayanta
    Member
    Posted 9 months ago #

    Thanks a ton keesiemeijer. Its done.

    Have a great day...
    God bless... :)

Reply

You must log in to post.

About this Topic