How can I remove a collection link without breaking my theme?

So I have a theme where the Title of the Collection (on the homepage section) has a link to the collection by default. I simply want to remove the link, but for some reason no matter what I do I break the theme or the products from loading. Should be so simple but I can’t figure it out. Any help would be GREATLY appreciated.

------code below-----

1 %} data-sorting-collections-control{% endif %}> {%- for block in section.blocks -%} {%- if collections[block.settings.collection] != blank -%}

1 %}{% if forloop.index == 1 %} class="active"{% endif %}{% endif %} data-collection="{{ collections[block.settings.collection].handle }}">{% if block.settings.title != blank %}{{ block.settings.title }}{% else %}{{ collections[block.settings.collection].title }}{% endif %}

{%- elsif forloop.index0 == 0 -%} {% render 'no-blocks' with message: 'homepage.onboarding.no_content_message.sorting_collections' %} {%- endif -%} {%- endfor -%}

Hi There!

Replace the code you shared with the one below:

 1 %} data-sorting-collections-control{% endif %}>
{%- for block in section.blocks -%}
{%- if collections[block.settings.collection] != blank -%}
#### 
 1 %}{% if forloop.index == 1 %} class="active"{% endif %}{% endif %} data-collection="{{ collections[block.settings.collection].handle }}">{% if block.settings.title != blank %}{{ block.settings.title }}{% else %}{{ collections[block.settings.collection].title }}{% endif %}

{%- elsif forloop.index0 == 0 -%}
{% render 'no-blocks' with message: 'homepage.onboarding.no_content_message.sorting_collections' %}
{%- endif -%}
{%- endfor -%}

Hello!

THANKS for trying but the products in the collection don’t load after the change.

Any other ideas?

This is very weird, switching the href of an element here should have zero effect on the loading of the products. Is there more code in that liquid file that’s using the URL somehow?

That’s what I thought? It’s like I could fix one thing but then the products wouldn’t load.

Here’s all the code for this section:

{%- if section.blocks.size > 0 -%}
    {% include 'global-variables' %}
    {% if sorting_collections_async_ajax_loading == true and content_for_header contains 'Shopify.designMode' %}
        {%- assign is_design_mode = true -%}
        {%- assign sorting_collections_async_ajax_loading = false -%}
    {%- endif -%}
    
        

            

                
 1 %} data-sorting-collections-control{% endif %}>
                    {%- for block in section.blocks -%}
                        {%- if collections[block.settings.collection] != blank -%}
                            #### 
                                 1 %}{% if forloop.index == 1 %} class="active"{% endif %}{% endif %} data-collection="{{ collections[block.settings.collection].handle }}">{% if block.settings.title != blank %}{{ block.settings.title }}{% else %}{{ collections[block.settings.collection].title }}{% endif %}
                            
                        {%- elsif forloop.index0 == 0 -%}
                            {% render 'no-blocks' with message: 'homepage.onboarding.no_content_message.sorting_collections' %}
                        {%- endif -%}
                    {%- endfor -%}
                

                {% capture grid %}col-6 col-sm-6 col-md-4 col-lg-{{ 12 | divided_by: section.settings.size_of_columns }}{% endcapture %}
                {%- for block in section.blocks limit: 1 -%}
                    
                        {% unless sorting_collections_async_ajax_loading %}
                            {%- if block.settings.collection != blank -%}
                                {%- assign products = collections[block.settings.collection].products -%}
                                {%- for product in products limit: section.settings.max_count -%}
                                    

                                        {%- assign disable_lazyload = sorting_collections_image_lazyload_disable -%}
                                        {% include 'product-collection' with url_without_collection: true product_margin_bottom: offset_collection_page_product_margin_bottom_d %}
                                    

                                {%- endfor -%}
                            {%- endif -%}
                        {% endunless %}
                    

                {%- endfor -%}
            

        

    

    
{%- else -%}
    {% render 'no-blocks' %}
{%- endif -%}

{% schema %}
{
    "name": "Collections",
    "settings": [
{
"type": "select",
"id": "size_of_columns",
"label": "Size of the columns",
"default": "4",
"options": [
{
"value": "2",
"label": "2 items in the row"
},
{
"value": "3",
"label": "3 items in the row"
},
{
"value": "4",
"label": "4 items in the row"
},
{
"value": "6",
"label": "6 items in the row"
}
]
},
        {
            "type": "range",
            "id": "max_count",
            "min": 1,
            "max": 24,
            "step": 1,
            "unit": "pds",
            "label": "Max count",
            "default": 8
        }
    ],
    "blocks": [
        {
            "type": "collection",
            "name": "Collection",
            "settings": [
                {
                    "type": "textarea",
                    "id": "title",
                    "label": "Title"
                },
                {
                    "type": "collection",
                    "id": "collection",
                    "label": "Collection"
                }
            ]
        }
    ],
    "presets": [
        {
            "name": "Collections",
            "category": "6) Collections"
        }
    ]
}
{% endschema %}

Not the most straightforward solution here but that should work:

 1 %} data-sorting-collections-control{% endif %}>
{%- for block in section.blocks -%}
{%- if collections[block.settings.collection] != blank -%}
#### 
{% if block.settings.title != blank %}{{ block.settings.title }}{% else %}{{ collections[block.settings.collection].title }}{% endif %}
 1 %}{% if forloop.index == 1 %} class="active"{% endif %}{% endif %} data-collection="{{ collections[block.settings.collection].handle }}">{% if block.settings.title != blank %}{{ block.settings.title }}{% else %}{{ collections[block.settings.collection].title }}{% endif %}

{%- elsif forloop.index0 == 0 -%}
{% render 'no-blocks' with message: 'homepage.onboarding.no_content_message.sorting_collections' %}
{%- endif -%}
{%- endfor -%}

It worked!

THANK YOU SO MUCH for your time and help!!!

You’re most welcome!! Should you need anything please feel free to contact me!

Cheers!