My Site Logo Disappear Again

My website logo disappear without any reason. Whetehr site's code is disturbed by others. Please check attachment. (http://onlydinosaurs.com)

  • Ash

    Hello OnlyDinosaurs

    Please try the following css:

    #sticky-menu-logo {
        display: block;
        position: absolute;
        top: -40px;
        height: 80px;
        left: 20px;
    }
    
    #sticky-menu-logo img {
        height: 77px;
    }
    
    .u-design-fixed-menu-on.fixed-menu #navigation-menu #sticky-menu-logo {
        display: inline-block;
        float: left;
        height: 40px;
        padding-left: 20px;
        position: static;
    }

    You can use this css in a plugin called Simple Custom CSS: https://wordpress.org/plugins/simple-custom-css/ Or you can use a child theme: https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

  • James Morris

    Hello OnlyDinosaurs,

    While there's a lot of plugins out there to add code directly to wp_head and wp_footer, WordPress *still* doesn't have a hook for directly after the opening <body> tag, oddly enough. :disappointed:

    In order to accomplish this, you'll need to get your hands a little dirty in the code. The following tutorial on WordPress Stackexchange covers this very thing, and it's pretty simple. https://wordpress.stackexchange.com/a/219938

    Here's a sample mu-plugin you could drop in (once you've modified header.php) that should do the trick.

    <?php
    function add_gtm_to_head() {
    	?>
    
    	<!-- Google Tag Manager -->
    	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    	})(window,document,'script','dataLayer','GTM-*******');</script>
    	<!-- End Google Tag Manager -->
    
    <?php
    }
    
    add_action( 'wp_head', 'add_gtm_to_head' );
    
    function add_gtm_after_body_open_tag() {
        ?>
    
    	<!-- Google Tag Manager (noscript) -->
    	<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-*******"
    	height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    	<!-- End Google Tag Manager (noscript) -->
    
        <?php
    }
    
    add_action('after_body_open_tag', 'add_gtm_after_body_open_tag');

    Update GTM-******* with the correct value, of course. :wink:

    Just save the above code in a file named add-gtm-code.php and upload it to wp-content/mu-plugins/add-gtm-code.php

    Then, in your child theme, add the following code just after the opening <body> tag in header.php

    <body <?php body_class(); ?>>
    //Add after body open hook
    <?php do_action('after_body_open_tag'); ?>

    I hope this clarifies a bit. Let us know if you have any further questions. We'll be happy to help! :slight_smile:

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.