Support » Theme: Blocksy » Logo URL – different to home page

  • Resolved mattartley

    (@mattartley)


    is it possible to change where the logo in the header would link to?

    I’m working on an e-commerce site which is an addition to an existing site, using woo, and client wants the logo to link to the store page rather than the “home” page – I’ve looked about a bit and it doesn’t seem possible easily without hacking things a bit.

    thanks πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)
  • Theme Author creativethemeshq

    (@creativethemeshq)

    Hey @mattartley,

    Thanks for contacting us!

    That’s actually very easy to implement and no hacking required πŸ˜‰
    Just put this piece of code in your child theme’s “functions.php” file:

    add_filter('blocksy:header:logo:url', function ($url) {
      return 'YOUR_URL';
    });

    Hope this helps!

    Thread Starter mattartley

    (@mattartley)

    Thanks for awesome response πŸ™‚

    However – it doesn’t seem to work! I’ve added it exactly as you’ve put it, changed URL to the URL I want it to point at, but when I click it it still just takes me to the website home page. I’ve cleared cache etc.

    I tried removing the ” around the website – and that broke the site, so it’s definitely reading the php file etc.

    the version I’m on is newest, 1.7.53

    site is https://www.barneysdeli.co.uk

    Thread Starter mattartley

    (@mattartley)

    Thanks πŸ™‚

    this is my functions.php:

    <?php
    if (! defined(‘WP_DEBUG’)) {
    die( ‘Direct access forbidden.’ );
    }
    add_action( ‘wp_enqueue_scripts’, function () {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    });

    add_filter(‘blocksy:header:logo:url’, function ($url) {
    return ‘https://www.barneysdeli.co.uk/shop&#8217;;
    });

    If we can’t resolve I’ll sort you some login creds this evening when I get back to a computer (out on site at the moment). Thanks for all your help!

    Thread Starter mattartley

    (@mattartley)

    though maybe now I’ve spotted the problem – I don’t know why it’s added &#8217 on the end… let me just remove that and see what happens..

    Thread Starter mattartley

    (@mattartley)

    <?php
    if (! defined('WP_DEBUG')) {
    	die( 'Direct access forbidden.' );
    }
    add_action( 'wp_enqueue_scripts', function () {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    });
    
    add_filter('blocksy:header:logo:url', function ($url) {
      return 'https://www.barneysdeli.co.uk/shop';
    });

    ignore I think it’s my lack of ability to use a forum πŸ™‚ I’ve now added it as a code snippet

    Theme Author creativethemeshq

    (@creativethemeshq)

    @mattartley Sorry. That was indeed a glitch from our side. It’ll be fixed with the next release (hopefully out today or tomorrow the latest). Let me know if you need a hot fix.

    Thread Starter mattartley

    (@mattartley)

    I’m glad! I thought I was going mad πŸ™‚

    No hot fix required – next update is great.

    Thanks for all your updates and great theme!

    Thread Starter mattartley

    (@mattartley)

    This is now working since the theme update! thanks very much πŸ™‚

    Hi guys,

    Please advise what code I need to include to just remove the link from the logo?

    Theme Author creativethemeshq

    (@creativethemeshq)

    @igor4wp I’d advise you to not remove the link, since this will lead to bad HTML semantics. If you just don’t want to have the logo clickable at all, please use this CSS:

    
    .site-branding {
      pointer-events: none;
    }
    

    Hope this helps.

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