Hiding the "related articles" box when there are no other articles in the section

Respondida

1 Comentarios

  • Pulkit Pandey
    Community Moderator
    Zendesk Luminary

    Hi Josh Hersh

    Please add the below code at the bottom of your script.js file 

      var articleSidebar = document.querySelector(".sidebar-section-articles ul").childElementCount;
      if(articleSidebar <= 1) {
         document.querySelector(".sidebar-section-articles").classList.add("hidden");
      }

    And also place the below CSS code at the bottom of your style.css file

    .hidden {
    display: none;
    }

    Let me know if it solves your issue

    Thanks 

    Pulkit

    Team Diziana

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk