[Resolved] Hook Element stopped working

Home Forums Support [Resolved] Hook Element stopped working

Home Forums Support Hook Element stopped working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1612584
    jregist

    My site is at https://gfa.wishfulthinking.us/

    I updated the image for the logo on our site, and suddenly the Hook Element that switched to the white menu (for pages with image backgrounds) stopped working. It has been working fine until I made this update to the image files. Here’s the text of the php.

    
    <?php if ( is_page( array( 12, 179, 'Blog' ) ) ) : ?>
    <script>
    	function getLogo() {
    		var img = document.getElementsByClassName('header-image')[0];
    		img.src='https://gfa.wishfulthinking.us/wp-content/uploads/2021/01/Logo_subtitle_white_updated.png';
    	}
    	getLogo();
    </script>
    <?php endif; ?>
    

    The hook I am assigning this is wp_footer. And the display rules is all pages.

    #1612631
    Leo
    Staff
    Customer Support

    Hi there,

    Sorry not sure why the custom function is needed there?

    Have you considered using our built-in header element solution?
    https://docs.generatepress.com/article/transparent-header-and-navigation/

    We cannot help with custom code in the forum here.

    #1613348
    jregist

    I didn’t think I could use the built-in Header element because of my split nav with the logo in the center.

    I’m looking into this now. Do you foresee any issues with the split nav that I’m using?

    #1613394
    Leo
    Staff
    Customer Support

    The header element method should work for the split nav ๐Ÿ™‚

    #1613414
    jregist

    Nice – I got it working on this page as a test – https://gfa.wishfulthinking.us/first-page/

    However, it looks like there’s a style issue. Logo coming after the right nav instead of in the middle. This is a much better solution. Can you give me any ideas about how to fix the styles?

    #1613547
    jregist

    Actually, I found the issue with my custom code. If you have a quick fix for the header layout css with the Header element, let me know. Thanks!

    #1613548
    jregist

    Thanks for the help!

    #1613662
    Leo
    Staff
    Customer Support

    Is everything good now?

    Please open a new topic if you need another look with something else ๐Ÿ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.