Skip to main content

Problem when publishing a page: bars appear at the top

Hey guys, I have a question. Now, when I publish a page using the Fluent Community template, a regular user sees their user bar at the top of the page with a black bar below it. It doesn't matter if I'm using Elementor or WordPress's native plugin. I'm using the default Fluent Community template. It used to work, but these bars appear after the latest updates. Has this happened to anyone else, or maybe Shahjahan Jewel can tell me how to fix it?

Thanks

Problem when publishing a page: bars appear at the top

Drive Zone

Looks like conflict with default WP admin top bar.

Drive ZoneΒ But it only happens with pages. I've removed all plugins, leaving only Fluent Community with Gutenberg, and nothing, the error persists. I've tried some code snippets I've seen from other users, even using AI, but I can't find a solution.

Drive Zone

JosΓ© Carlos EstiradoΒ I think you can fix it with css relatively easily.

Drive ZoneΒ I'll look into it and see if I can fix it with code.

I've already fixed it with a snippet; I'll leave it here in case anyone else runs into it. It's PHP.

add_action('after_setup_theme', function () {
    if (is_admin()) {
        return;
    }

    if (current_user_can('administrator')) {
        return;
    }

    show_admin_bar(false);
});