• Resolved carobina

    (@carobina)


    Hi, I am trying to get a site together for a young NGO, and try to get the logo inside the nav bar, to the left. I use the feature image as background in the header and managed to get the navigation above and to the right, and even made it stick – but I can’t get the logo inside. It’s the free version – for two other NGO’s I could use the premium version, but here we can’t use that yet here.

    I tried with

    add_action(‘generate_inside_navigation’,’generate_navbar_logo’);
    function generate_navbar_logo() {
    ?<
    <div class=navigation-logo></div>
    >?php
    }

    and
    .main-navigation .site-logo {
    float: left;
    }

    getting the code from here https://www.ads-software.com/support/topic/css-for-menu-logo/

    But above php blows my site…

    I am not experienced at all: Is it allowed to get help here, or is this only possible with the premium version (or for clever developers)?

    Thanks to anyone answering in advance!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @carobina,

    How about this?:

    add_action('generate_inside_navigation','generate_navbar_logo');
    function generate_navbar_logo() {
    ?>
    <div class=navigation-logo>
    <img src="https://fazarcon.pluginsupportwp.com/wp-content/uploads/2023/02/header_image.jpg"/>
    </div>
    <?php
    }

    Replace https://fazarcon.pluginsupportwp.com/wp-content/uploads/2023/02/header_image.jpg with your image URL.

    Thread Starter carobina

    (@carobina)

    Hi @fernandoazarcon2, thanks for your help!

    Still gave me the same error message when activating the snippet:
    Uncaught Error: Undefined constant “‘generate_inside_navigation’” in this snippet…

    But because I thought you must know what you’re doing and your code is probably right, this time I understood, why, it was a silly reason: I had used the wrong ‘, they were slightly italic. Whereever they came from, once I typed it in again with the normal ‘ everything was hunkydory.

    Everything’s fine now, so thank you very much for your answer and for taking the time ??

    • This reply was modified 1 year, 9 months ago by carobina.

    You’re welcome, @carobina!

    Yes, copying and pasting sometimes replaces the quotation marks with slanted ones and that would prevent the code from working. Great find though!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘put logo left on navigation bar’ is closed to new replies.