Minimal theme: Remove slider from other pages after making it full-width

Hello, I made my slider full-width by adding this code to theme.liquid just before the tag.

{% section 'slider' %}

After that, I removed “slider” from settings_data.json to not to see any other in customization.

"content_for_index": [
     *it was supposed to be here*
      "1632257873140e1a8e",
      "featured-collection",

But now, all the pages have the slider. I tried to remove it from other pages in Customization section but did not work. I need a solution.
If there’s a safer way to make the slider full-width, that could be a better solution. Thanks!

my store url: https://wiggleduck.com/

@thevista888 - please add this css to the very end of your theme.scss file and check

#shopify-section-slider{display:none; visibility:hidden;}

.template-index #shopify-section-slider{display:initial; visibility:visible;}

You’re amazing. It worked. Thank you so much. I appreciate it. @suyash1

@thevista888 - welcome

I did the same but when I add the code in theme.scss file does not work for me.

It shows the slider and the code as text as you can see in the image below. :disappointed_face:

Can you help me?

Thanks!