Adding hyperlinks to titles

Solved
New Member
3 0 0

Hi there,

 

I' have two collections on my homepage: 'women's t-shirts' and 'men's t-shirts'.  I want to hyperlink the title of these featured collections to the correct collection page.

 

I have used the code below to add a hyperlink to the title, but it means both of the collections on my homepage link to the 'men's t-shirts' collection. I want the women's collections to link to women's shirts.

 

How do I single out the title 'women's t-shirts' to link to the correct collection?

 

Help much appreciated!

 

 

<div class="index-section home-section feature-collection feature-collection--{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="feature-collection">
<div class="wrapper wrapper--margins bottom--space">
  
    {%- assign collection = collections[section.settings.collection] -%}

    {% if section.settings.heading != blank %}
      {% if section.settings.show_view_all %}
        <div class="grid">
          <div class="grid__item large--three-quarters small--one-whole medium--one-whole">
      {% endif %}
      <h2 class="home-section-title"> 
        <a href="{{ "https://bornhybrid.com/collections/mens-eco-t-shirts" }}">
          {{ section.settings.heading | escape }}</h2>
      {% if section.settings.show_view_all %}
        </div> 
          <div class="grid__item large--one-quarter small--one-whole medium--one-whole text-right medium-down--text-center view-all">
            <a href="https://bornhybrid.com/collections">
              <span>{{ 'collections.general.view_all' | t }}</span>
              {% include "asset_svg" with "arrow_right" %}</a>

 

0 Likes

Success.

Shopify Expert
2490 417 525

Hi,

Change your code to bellow:

 

<a href="{{ collection.url }}">

Let me know if you need help.

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
1 Like
New Member
3 0 0

Amazing, thank you so much Jasoliya! Really appreciate your help :)

0 Likes
New Member
1 0 0

Hi Jasoliya, I am using debut theme and have a number of featured collections on my home page that I would like to hyperlink the titles of ?

 

Is this possible and if so would you perhaps mind explaining it to me? 

 

Many thanks,

0 Likes