• Resolved mrapeone

    (@mrapeone)


    Hello,

    how can i remove the admin bar on the mobile version?
    I use the Newspaper theme from TagDiv, also the mobile version of them.
    I tried everything, but I just can’t get it away with the mobile version.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @mrapeone Are you referring to the standard WordPress admin bar, not specific to the AMP plugin? Your theme may have specific options which you must toggle, it may be best to con contact tagDiv support regarding this.

    You can also try a function similar to the below, added to your themes functions.php.

    if(wp_is_mobile()){
    add_filter( 'show_admin_bar', '__return_false' );
    }
    zo

    (@zotezo)

    We are using AStra theme but sometimes for AMP and non AMP pages sometimes showing Admin bar.How to completely remove those options in both AMP and non AMP pages?

    Plugin Author Weston Ruter

    (@westonruter)

    Are you using Jetpack? There was an issue in 8.4 which caused the admin bar to be hidden on AMP pages. Update to 8.4.2 and this will be fixed.

    zo

    (@zotezo)

    No I am not using jet pack but sometimes in my AMP and non amp pages admin bar in header on top area.I want to disable that area.What is the easiest solution to do that?

    Plugin Author Weston Ruter

    (@westonruter)

    The AMP plugin doesn’t force the admin bar to appear on the frontend. It respects the “Show Toolbar when viewing site” setting in the WordPress admin. It also respects forcing the admin bar to be hidden via the show_admin_bar filter. So if the admin bar is still showing up for you then there is some other issue.

    Note that AMP does not equal mobile. If you want to hide the admin bar on AMP pages, you should use this code:

    add_filter( 'show_admin_bar', function( $show ) {
    	if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    		$show = false;
    	}
    	return $show;
    } );
    zo

    (@zotezo)

    For both AMP and Non AMP Pages?

    Plugin Author Weston Ruter

    (@westonruter)

    If you want to hide it everywhere, do:

    add_filter( 'show_admin_bar', '__return_false' );

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Mobile Admin bar disable’ is closed to new replies.