• Resolved valuser

    (@valuser)


    On small screens (less than 768px) the default wp admin bar icons/menu items devolve to just the icons alone which is great.

    but (for me) custom icons/pngs and menu items disappear on screens less than 768px (or thereabouts – tablet portrait view and all phones – tablet landscape perfect)

    Would like the icons/pngs to stay on the small screens just like the normal WP admin bar.

    This was previously raised and not replied to on this forum at:
    https://www.ads-software.com/support/topic/icons-and-menu-items-disappear-when-on-small-screens?replies=1

    So far found very little searching on this.

    See the problem at test site https://www.trulysuperb.com/

    Reduce the browser to less than 768px and only the wp icon remains – the others are gone (not just hidden)

    The code with which i inserted the menu items begins as below (and see in full at https://pastebin.com/pqhn5i7H )

    function kcustom_adminbar_menu() {
    
    	global $wp_admin_bar;
    
    		/*if ( !is_user_logged_in() ) { return; }*/
    
    			$wp_admin_bar->add_menu( array(
    
    			'id' => 'kcustom_menu',
    
    			'title'  => __('<img src="https://www.trulysuperb.com/wp-content/globalimages/our28.png" style="vertical-align:middle;margin-right:12px;margin-top:-3px;margin-left:-10px;" alt="Our Place" title="Our Place" />Our Place') ) /* set the menu name */
    
    		);
    
    		/* menu link */
    
    		$wp_admin_bar->add_menu( array(
    
    			'parent' => 'kcustom_menu',
    
    			'id'     => 'Our Place', /* unique id name */
    
    			'title'     => 'Our Place', /* Set the link title */
    
    			'href'  => network_site_url(), /* Set the link a href */
    
    			)
    
    		);
    etc etc
    }
    add_action( 'admin_bar_menu', 'kcustom_adminbar_menu', 15 );

    Any ideas as to how to get the icons/pngs to stay on the small screens just like the normal WP admin bar would be really appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Put the icon inside an element with the class of “ab-icon” and the label inside an element with the class “ab-label”, just like core does it. Only the label section is hidden, the icon should remain.

    Also, please don’t post the same question in our forums multiple times. Once is enough.

    Thread Starter valuser

    (@valuser)

    Thank you. Point taken. Apologies.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp admin-bar custom icons/menu-items-disappear on-small-screens’ is closed to new replies.