php - offsetting hash by 28px to accommodate admin bar for logged in Wordpress users -


Because of the AdWords bar that shows up to log in to my WordPress site, hash links do not work because I I want to do as much work as they do, that is how they work, but the hash is hidden by the wordpress admin bar above the div. That's why I am thinking that there is a way that, for logging in users, all the hash status can be offset from 28px so that they appear correctly.

Possibly, if there is a script that requires me to add it to my functions.php file and wrap it in:

  if (is_user_logged_in ()): [Script here] endif;    

You really want to do this in javascript. I'm assuming that you have jquery running. You can use the following code. It will run at all times:

  jQuery .jpg (.jpg) .jQuery (.bind) .bind ("hashchange", function () {jQuery ("html, body"). ScrollTop (jQuery (window) .scrollTop () - 28);});});) ????   

If you want to run only when you log in, you can resize your template with PPE, with some (not tested) rows:

  if (is_user_logged_in ()): countermanded '  

Work example:

Thomas

Comments