Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Sticky header not working fix

$
0
0

Replies: 0

Hi StyleMix,

I think I found the issue related to the sticky option not working.
Have a look at line 16 in hb_templates/main.php

The database option is not retrieved correct, and the line should be:

<script type="text/javascript">
        var stm_sticky = '<?php echo esc_js( stm_hb_get_option( 'header_sticky', '', $hb ) ); ?>';
    </script>

To further optimize the output, in case no sticky is selected (value becomes empty) the code could check for that:


$stm_sticky = esc_js( stm_hb_get_option( 'header_sticky', '', $hb ) );

if ( ! empty ( $stm_sticky ) ) {
	echo sprintf( '<script type="text/javascript">var stm_sticky = \'%s\';</script>', $stm_sticky );
}

Let me know what you think and if this can be added into an upcoming version of the plugin.

Thanks,
Ruud

  • This topic was modified 5 minutes ago by Ruud Laan.

Viewing all articles
Browse latest Browse all 59525

Trending Articles