Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1290775
    baywestchurch1
    Participant

    How do I change the link on the logo in the topbar?

    #1290848
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    Please add following code in Customize -> Custom -> Javascript:

    jQuery('.x-brand').attr('href', 'http://example.com/');

    Please don’t forget to change http://example.com/ to whatever URL you like.

    Thanks.

    #1291372
    baywestchurch1
    Participant

    Thanks so much!

    #1291447
    Joao
    Moderator

    You are welcome,

    Joao

    #1292204
    baywestchurch1
    Participant

    It didn’t work the way I wanted, and I think it’s because I didn’t explain clear enough and left out crucial info…might not be as simple as I asked.

    I have a video header that plays when you hit the site, then you click and it scrolls down to the site. With the help of tech support here, I placed code in the php to allow the home button on the menu to go to “http://7ad.ac4.myftpupload.com/#home” when bypassed the video banner, so they didn’t have to load it and scroll down every time they clicked to go back to the home page. The logo link still took them back to teh video banner, so I thought I’d change the logo link to the above address with the bookmark in it, but for some reason, it doesn’t hit that bookmark.

    #1292374
    Lely
    Moderator

    Hello There,

    Please move the suggested code to Appearance > Customize > Custom > Edit Global Javascript.
    jQuery('.x-brand').attr('href','7ad.ac4.myftpupload.com/#home');

    Code added here:Appearance > Customize > Custom > Edit Global Javascript. will work on every pages on your site unless the code is filtered per page.
    On the other hand, code added here Settings Tab > Custom Javascript will only work on the specific page. In your case it is working on homepage only.

    Hope this helps.

    #1343796
    baywestchurch1
    Participant

    Hi, I hate to reactivate this thread, but I noticed a problem that I didn’t check out fully when this was put in. I’ve since changed my baywestchurch.com.

    I put this in Appearance > Customize > Custom > Edit Global Javascript…but what it does now is make the logo link be this…

    baywestchurch.com/baywestchurch.com/#home

    The logo is in the menu bar at the top of the page on every page. On every other page it puts the address of that page in front of the link in the code snippet above. For example, on the about page (which is named “about-2”) the logo links to…

    baywestchurch.com/about-2/baywestchurch.com/#home

    Help? (The url and login and all that is above in the thread.)

    EDIT: In addition, all the social media icons in my top bar do that to, so the facebook icon links to…

    baywestchurch.com/about-2/www.facebook.com/baywestchurch

    #1344297
    Friech
    Moderator

    Hi There,

    Since you have a child theme lets utilize that. First please remove the JavaScript we suggested above.

    Then login to your server via FTP and navigate to your child theme’s /x-child/framework/views/global/ directory. There create a file named _brand.php and paste the code below on it.

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_BRAND.PHP
    // -----------------------------------------------------------------------------
    // Outputs the brand.
    // =============================================================================
    
    $site_name        = get_bloginfo( 'name' );
    $site_description = get_bloginfo( 'description' );
    $logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
    $site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';
    
    ?>
    
    <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>
    
    <a href="http://baywestchurch.com/#home" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
    </a>

    See the line http://baywestchurch.com/#home ? That is where your logo will be link.

    Regarding your social icons, make sure there is no number sign [#] or slash [/] or any character on front of it. And make sure you use an absolute link.

    e.g.
    https://www.facebook.com/yourthemeco/

    Hope it helps, Cheers!

    #1345018
    baywestchurch1
    Participant

    That fixed the social media links…and the logo had the same problem, so before I dumped the code and created the _brand.php, I took another look at the code, and in the code I copied, there was no “http://&#8221; before the temporary url or the new url because I just replaced it as it was.

    So I put “http://&#8221; before the link in the original code and it’s fixed.

    Thanks for the reply and for the code you put up, and for the comment that ultimately exposed the problem and led to a really quick fix.

    #1345214
    Jade
    Moderator

    You’re most welcome!

    #1365005
    baywestchurch1
    Participant

    FYI. Had one other issue on this. I put the code in, and when I mouseover, it shows the correct link to the page and bookmark, but when I click on it….it just sits there and doesn’t go to the page.

    If I right click and then open it in the new tab, works fine, but won’t work on a direct click.

    Any thoughts?

    #1365439
    Friech
    Moderator

    Hi There,

    I can’t replicate that issue on my end, I tried it on Chrome and Firefox. Is there a chance that you have some kind of blocker (extension) installed on your browser?

    Thanks.

    #1366681
    baywestchurch1
    Participant

    Maybe, I’ll check it.

    #1366787
    Christopher
    Moderator

    Let us now if you have further questions.

  • <script> jQuery(function($){ $("#no-reply-1290775 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>