Blog Post - Remove author from 1 post

Hi,

I recently added this code to the functions.php, to add a section (end of post) about the author.
Now, I want to remove it only from one specific blog post.

Can you help?

add_action( "x_after_the_content_end", "add_post_shortcode" );

function add_post_shortcode() {
    if( is_singular( 'post' ) ){
        echo do_shortcode('[author title="About the Author"]');
    }
}

Thank you

Hi @PanInternational,

Thank you for reaching out to us. To remove the author box from a specific post, first find the post ID by following this article https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59

After finding the post ID, let’s say it is postid-25, simply add the following code in the Theme Options > CSS:

.postid-25 .x-author-box {
    display: none;
}

Make sure to replace the postid-25 with your actual post ID in the above code. Don’t forget to clear all caches including your browser’s cache after adding the code. Let us know how this goes!

Thank you @Nabeel

You’re welcome, @PanInternational. Glad we’re able to help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.