wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

[Solved] offset scrolling


odi20
Posts: 5
Topic starter
(@odi20)
Active Member
Joined: 3 months ago

Hi, My website has a fix header with height of 49px. After commenting, it scroll the page to the start of comment that is under the fix header. How can I offset to scroll in +49px?

Topic Tags
5 Replies
Asti
Posts: 3852
 Asti
Support
(@asti)
Support member
Joined: 4 years ago

@odi20,

You'll be able to control this using the wpdiscuz_js_options hook in the next version of the wpDiscuz plugin. The new parameter will be added, so it'd be possible to control it. 

4 Replies
odi20
(@odi20)
Joined: 3 months ago

Active Member
Posts: 5

@asti Thanks, so i have to wait. Any estimated time for release? 🤩

Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 3852

I'm sorry, but we can't provide any ETA yet.

Asti
 Asti
Support
(@asti)
Joined: 4 years ago

Support member
Posts: 3852

Hi @odi20,

Here is the solution:

add_filter("wpdiscuz_js_options", function($options){
    if (!empty($options["scrollSize"])) {
        $options["scrollSize"] = 130;
    }
    return $options;
});

You'll just need to change the red marked value as it's necessary in the case of your website. 

The code should be put in your active theme functions.php file.

odi20
(@odi20)
Joined: 3 months ago

Active Member
Posts: 5

@asti Thank you. Perfectly worked.

Share: