HEX
Server: Apache/2.4.37 (AlmaLinux) mpm-itk/2.4.7-04 OpenSSL/1.1.1k PHP/7.2.24
System: Linux cp.iqhost.ru 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User: iq22073873 (6195)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /var/www/iq22073873/data/www/bckln.ru/wp-content/themes/dt-the7-child/functions.php
<?php
/**
 * Your code here.
 *
 */
 /*--- menu ---*/
show_admin_bar( false );
register_nav_menus( array(
	'right-menu' => __('Menu Right')
));
if(function_exists('register_sidebar')){
	register_sidebar(array(
		'name' => 'Social Sidebar',
		'before_widget' => '<div id="%1$s" class="widget %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h3>',
		'after_title' => '</h3>'
	));
}


add_action( 'wp_head', 'truemisha_script_to_head', 25 );
 
function truemisha_script_to_head() {
	echo '<script>
        window.addEventListener("load", function(){
            var logoTop = document.querySelector(".branding");
            var logoBox = document.querySelector(".logo-box");
            var logoMobil = document.querySelector(".mobile-branding");

			if (logoTop) {
				logoTop.addEventListener("click", function() {
				document.location.href = "/";
				});
			}

			if (logoBox) {
				logoBox.addEventListener("click", function() {
				document.location.href = "/";
				});
			}

			if (logoMobil) {
				logoMobil.addEventListener("click", function() {
				document.location.href = "/";
				});
			}

            var locHash = window.location.hash;
            if(locHash.match("^#!")){
                var urlHash = locHash.substring(3);
            }
            else if(locHash.match("^#")){
                var urlHash = locHash.substring(1);
            }

            if( typeof urlHash != "undefined" && urlHash.length > 0 ) {
                setTimeout(function() {
                    const topPos = jQuery("#" + urlHash).offset().top
                    jQuery("html, body").animate({ scrollTop: topPos }, 600);
                }, 500);
            }
        });
        
	</script>';

}

?>