# Change destination of logo link

**URL:** <https://meta.discourse.org/t/change-destination-of-logo-link/152001>\
**Category:** Product Support\
**Created:** [19 mei 2020 om 21:23 UTC](https://meta.discourse.org/t/change-destination-of-logo-link/152001 "2020-05-19T21:23:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [19 mei 2020 om 21:23 UTC](https://meta.discourse.org/t/change-destination-of-logo-link/152001/1 "2020-05-19T21:23:29Z")

</div>

I’ve got a site where a bunch of groups have their own categories, and there is a desire to have these categories branded with the group owner’s logo.

For each category there is code like

```css
.category-org .d-header {
    color: white !important;
    background-color: white !important;
    background-image: none !important;
    background:white !important;
}

.category-org #site-text-logo {
  content: url("/uploads/default/original/1X/a9d7d4f215f2013907002ffe13456d3f90a7f108.png") !important;
  display: inline-block;
  height: 50px;
  font-size: 0;
  margin-top: 5px;
  margin-bottom: 0px;
}

```

The trick is that when you click the logo, you’re taken to the site home rather than the category. This is (mostly) solved by the following:

```plaintext
<script type="text/javascript">
$(document).ready(function() {
  $(".title #site-text-logo").click(function(event){

    // don't navigate to base url
    event.preventDefault();
    
    // get category active from div id
    div = $("body[class*='category-']")[0];

    // extract slug from class that startswith category-
    var classes = $(div).attr('class');

    var slug = classes.match(/category\-.+/g)[0].replace("category-","").split(" ")[0];
    // set the href to be the slug url
    document.location = "/c/" + slug + "/";
  })
});
</script>

```

If you click on the logo on either a category or topic page, you go to the category page. Hooray!

**BUT** if you click in the tiny space between the logo and the bottom of that header, you go to the home page rather than the category page. It’s pretty much impossible to distinguish when you’ll get which action. When you mouse over the URL at the bottom of Chrome has the site home page rather than the category URL regardless of where you’re going to go.

(I used [Custom Header Links](https://meta.discourse.org/t/custom-header-links/90588) to add a link to the home page. I don’t believe that it has anything to do with the above behavior.)

And I can’t share the site because the per-unit categories are visible only to group members.

---

_[View the full topic](https://meta.discourse.org/t/change-destination-of-logo-link/152001)._
