title: Disable centerMode if first or last slide is active - Slick Slider
body: <p>I have Slick slider in Wordpress single post's header. I am trying to disable <code>centerMode</code> if the first or last slide is active. I am trying to do it in this way:</p>
  <pre><code>let slider = $('.templateOverview-slider .slick-slide');
  if (slider.first().hasClass('slick-current')) {
      $('.templateOverview-slider').slick('slickSetOption', 'centerMode', false);
  } else if (slider.last().hasClass('slick-current')) {
      $('.templateOverview-slider').slick('slickSetOption', 'centerMode', false);
  }
  </code></pre>
  <p>But <code>centerMode</code> is not disabled. Can anyone please tell me what I am doing wrong, and how can I disable <code>centerMode</code>?</p>