{"id":13741,"date":"2025-07-14T00:11:27","date_gmt":"2025-07-14T00:11:27","guid":{"rendered":"https:\/\/www.kadencewp.com\/help-center\/?post_type=docs&#038;p=13741"},"modified":"2026-04-22T16:12:03","modified_gmt":"2026-04-22T16:12:03","password":"","slug":"adjust-kadence-themes-scroll-offset-using-a-filter","status":"publish","type":"docs","link":"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-theme\/adjust-kadence-themes-scroll-offset-using-a-filter\/","title":{"rendered":"Adjusting the Kadence Theme&#8217;s scroll offset using a filter"},"content":{"rendered":"\n<p>The Kadence Theme has the <code>kadence_scroll_to_id_additional_offset<\/code> filter that allows users to modify the additional vertical offset (in pixels) applied when scrolling to anchor links using Kadence\u2019s built-in smooth scroll behavior. <em>It does not modify animation timing or speed.<\/em><\/p>\n\n\n\n<p>This can be useful if you have custom sticky headers, admin bars, or dynamic content that affects how far the page should scroll when targeting an element by ID.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>$offset<\/code><\/strong> <em>(int)<\/em> &#8211; The default additional offset. Defaults to <code>0<\/code>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Usage<\/h3>\n\n\n\n<p><strong><em>Add 120 pixels offset and take into account if a user is logged in (admin bar is showing)<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">add_filter('kadence_scroll_to_id_additional_offset', function($offset){\n    $offset = 120;\n    $admin_bar = is_admin_bar_showing() ? 32 : 0;\n    \n    return $offset + $admin_bar;\n});<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Add the PHP code snippets using a plugin. Refer to our guide here: <strong><em><a href=\"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-theme\/how-to-add-a-custom-filter-or-function-with-code-snippets\/\">How to add a custom filter or function with Code Snippets<\/a><\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Kadence Theme has the kadence_scroll_to_id_additional_offset filter that allows users to modify the additional vertical offset (in pixels) applied when scrolling to anchor links using Kadence\u2019s built-in smooth scroll behavior. It does not modify animation timing or speed. This can be useful if you have custom sticky headers, admin bars, or dynamic content that affects&#8230;<\/p>\n","protected":false},"author":115173,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"doc_category":[405],"doc_tag":[],"knowledge_base":[6],"class_list":["post-13741","docs","type-docs","status-publish","hentry","doc_category-theme-advanced","knowledge_base-kadence-theme"],"year_month":"2026-04","word_count":146,"total_views":"1661","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"display_name":"Karla","author_link":"https:\/\/www.kadencewp.com\/help-center\/author\/karla-levelup\/"},"doc_category_info":[{"term_name":"Advanced","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-theme\/theme-advanced\/"}],"doc_tag_info":[],"knowledge_base_info":[{"term_name":"Kadence Theme","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-theme\/","term_slug":"kadence-theme"}],"knowledge_base_slug":["kadence-theme"],"taxonomy_info":{"doc_category":[{"value":405,"label":"Advanced"}],"knowledge_base":[{"value":6,"label":"Kadence Theme"}]},"featured_image_src_large":false,"comment_info":0,"_links":{"self":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/13741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/users\/115173"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/comments?post=13741"}],"version-history":[{"count":6,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/13741\/revisions"}],"predecessor-version":[{"id":14428,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/13741\/revisions\/14428"}],"wp:attachment":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/media?parent=13741"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_category?post=13741"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_tag?post=13741"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/knowledge_base?post=13741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}