How to print partial URL after #? [closed]

First off, the “slug” is what it is by definition. There is no such thing as a “front slug”.

As you do not elaborate/know on how the anchors/hashes are generated on the server side, all I can give you is a JS solution (proof of concept):

if (window.location.hash) {
    alert(window.location.hash.substring(1));
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)