I’m working on a site where I need the admin bar to go away for non-admin users, and as seems sometimes to happen, the standard disabling method via action hook after_setup_theme isn’t fully removing the admin bar in this case — which has led me to a css-based workaround that simply “undisplays” the admin bar.
My solution is successful in disappearing the admin bar. The problem I now have, however, is that the sticky nav transition doesn’t work. When the admin bar is disappeared the way I’ve accomplished it, in other words, the sticky navigation div displays as expected when scrolling down-page, but it does not switch back to non-display on scrolling to top of document.
I gather that this is because the value for document position relative to viewport that GeneratePress code looks for to trigger the sticky transition with admin bar present in the document isn’t the value now being given when we scroll to top. Is there a straightforward way to adjust for this — that is, to use instead the 32px-height-difference I need it to look for, with the admin bar undisplayed?
Ha, I should have studied show_admin_bar more closely before assuming the way I’d been hiding the bar on other projects (which does use show_admin_bar, but deploys it via after_setup_theme) was the “standard method.” That does the job thoroughly — and I can get rid of my css workaround.
Sorry for the the clumsy inquiry! And thank you for the helpful redirection.