Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3831133
how to remove posts below admin name
Open

Comments

  • satyanandi191 started the conversation

    i want to delete post shown below admin name, it looks odd. when i click in author name, it gives author details but shows posts details which looks so odd. i attach two snap shots.

    Attached files:  Screenshot 2025-03-03 215017.png
      Screenshot 2025-03-03 215036.png

  •  2,786
    PenciDesign replied

    Hi,

    You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/

    function penci_user_remove_author_posts( $query ) {
        if ( ! is_admin() && $query->is_main_query() && $query->is_author() ) {
            $query->set( 'post__in', array(0) ); // Prevents any posts from being displayed
        }
    }
    add_action( 'pre_get_posts', 'penci_user_remove_author_posts' );
    

    Regards,
    PenciDesign.