offsetting hash by 28px to accommodate admin bar for logged in WordPress users (1 post)

  1. nickharambee
    Posted 3 years ago #

    Because of the admin bar that shows for logged in users on my WordPress site, hash links don't work as I'd like them to, i.e. they work as they should, but the top of the hash div is obscured by the WordPress admin bar. So I am wondering if there is a way that, for logged in users, the position of all hashes can be offset by 28px, so that they show up correctly.

    Presumably, if there is a script that can do this I will need to add it to my functions.php file and wrap it in:

    if (is_user_logged_in()) :
    [script here]

    Thanks for any help,


Topic Closed

This topic has been closed to new replies.

About this Topic