How to allow registered users to post comments anonymously ?

4 replies
When a registered user on my blog, write a post, automatically his name (linked to his profile page) is shown next to their post (I am using P2 theme). But I want to allow registered users to post anonymously without revealing their names or profiles and I want this in posts in only 1 specific categories "A". For other categories, I want that their name should appear next to their posts.

Can Anyone suggest a solution ???
#anonymously #comments #post #registered #users
  • Profile picture of the author CyberSEO
    1) Open your function.php in a text editor.
    2) Find the following line:
    Code:
    <?php echo get_comment_author_link(); ?>
    3) Replace it with
    Code:
    <?php if (!is_category("A")) echo get_comment_author_link(); ?>
    4) Save function.php and upload it to your host.
    Signature
    CyberSEO Pro - the ultimate all-in-one autoblogging WordPress plugin, powered by OpenAI GPT-4, Anthropic Claude, Google Gemini Pro, Midjourney, DALL-E 3 and Stable Diffusion XL
    {{ DiscussionBoard.errors[4953453].message }}
    • Profile picture of the author Garish Wasil
      Originally Posted by CyberSEO View Post

      1) Open your function.php in a text editor.
      2) Find the following line:
      Code:
      <?php echo get_comment_author_link(); ?>
      3) Replace it with
      Code:
      <?php if (!is_category("A")) echo get_comment_author_link(); ?>
      4) Save function.php and upload it to your host.
      Thanks a ton, CyberSEO. I was really desperate to know this. Even the wordpress.org community was not able to help.

      One more thing, If I add this code, will the posts also not show up on that author's archives page ???

      Update : Unfortunately, this only hides the profile link but the author name (non hyperlinked) is still shown next to the comment.
      {{ DiscussionBoard.errors[4956761].message }}
      • Profile picture of the author CyberSEO
        Originally Posted by garish View Post

        Update : Unfortunately, this only hides the profile link but the author name (non hyperlinked) is still shown next to the comment.
        Hmm, very strange... Perhaps we are talking about some different P2 themes, because on my one the code hides both - the author name and hyperlink.

        You may also to check this: http://codex.wordpress.org/Function_...nt_author_link - as you can see, the comment_author_link() function does print the author's name, but not just a hyperlink to its profile. So it seems our P2 themes are different.
        Signature
        CyberSEO Pro - the ultimate all-in-one autoblogging WordPress plugin, powered by OpenAI GPT-4, Anthropic Claude, Google Gemini Pro, Midjourney, DALL-E 3 and Stable Diffusion XL
        {{ DiscussionBoard.errors[4964896].message }}
  • Profile picture of the author windso0
    First step from the site actions drop down choose view all site content

    Click on the comments list and choose list from the ribbon

    Next click on List permissions as shown

    You will then need to stop inheriting permissions for this list

    Once you have broken inheritance your view on the ribbon will change as illustrated below you will need to click on anonymous access

    Once clicked you will be presented with the dialogue box below you will have to change the settings to allow Add Items – Add items to lists this will enable your readers to post comments on your new shiny SharePoint Blog.
    {{ DiscussionBoard.errors[4964724].message }}

Trending Topics