WordPress ScrollTo Hash

I needed to pass a hash, and scroll to the matching anchor on a new page.

Not as easy as it sounds in WordPress. (Pretty permalinks make it not work.)

After much testing and research, here’s the solution that worked best:

I added the “-150” after the offset to show the header above the anchor.

Leave a Reply

Your email address will not be published. Required fields are marked *