• Resolved surf4444

    (@surf4444)


    Hello,

    How do I get my transparent background logo at the top left of the web page and link it to the homepage?

    Thanks!
    Jon

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    You can achieve it by injecting a bit of jQuery code:

    jQuery(document).ready(function( $ ){
       $("<a href='https://www.yoursite3327.com/'><img src='https://www.yoursite3327.com/yourimage.png'></a>").prependTo(".site-branding");
    });

    Replace https://www.yoursite3327.com/ with an address of your website

    and https://www.yoursite3327.com/yourimage.png with an url of your logo.

    Let me know if you need help with finding your logo’s url or how to inject the jQuery code.

    TibbyWeb

    • This reply was modified 8 years, 1 month ago by TibbyWeb.
    Thread Starter surf4444

    (@surf4444)

    Thanks for your help! How do I go about injected the jQuery code?

    I believe this is what I need to inject:

    jQuery(document).ready(function( $ ){
    $(““).prependTo(“.site-branding”);
    });

    Thread Starter surf4444

    (@surf4444)

    Also, what if there is another image I want to use as my logo, but it does not live on the web yet and does not have a url?

    Moderator Kathryn Presner

    (@zoonini)

    Dyad supports a logo without the need to add any custom code. (But thanks for the workaround, TibbyWeb! That may be useful in other situations.)

    Once you activate the Jetpack plugin, you’ll get an option to upload a logo in your Customizer’s “Site Title, Tagline & Logo” panel.

    Customize Dyad 1 0 10 by Automattic tagline

    The logo will automatically link to your homepage.

    As a general heads-up, never edit your theme files directly, otherwise all your changes will be overwritten and lost every time you update the theme. If you do prefer to go the jQuery route, you should first set up a child theme. If you’re new to child themes, you can explore these guides:

    https://codex.www.ads-software.com/Child_Themes
    https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

    Keeping your theme up-to-date is strongly recommended to ensure you get bug fixes, security updates, and updates to keep the theme compatible with WordPress core.

    Thread Starter surf4444

    (@surf4444)

    Thank you!

    Thread Starter surf4444

    (@surf4444)

    Ok, so I got my logo at the top, but now when I scroll down the menu header disappears. How do I get it to stay static at the top?

    Moderator Kathryn Presner

    (@zoonini)

    Could you provide a link to your site? Did you add the logo using Jetpack or via the jQuery route? I just tested adding a logo via the Jetack method and my menu stayed fixed, so I’d like to take a look directly.

    Thread Starter surf4444

    (@surf4444)

    It is working now, sorry for the confusion!

    Moderator Kathryn Presner

    (@zoonini)

    Great! I’ll mark this thread as resolved but feel free to start a new one if you need help with anything else.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘My logo at top of site’ is closed to new replies.