Advertisement
websupporter

Hide WordPress admin bar on posts

May 7th, 2015
3,084
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. add_action( 'show_admin_bar', 'hide_admin_bar_on_posts' );
  3. function hide_admin_bar_on_posts( $show ){
  4.     if( is_single() && 'post' == get_post_type( get_the_ID() ) )
  5.         return false;
  6.     return $show;
  7. }
  8. ?>
Advertisement
RAW Paste Data Copied
Advertisement