Article Template - Sidebar to show only H1 headings

2 Comments

  • Ifra Saqlain
    Community Moderator

    Hey Abid,

    You can try this code:

    Add this code on your script.js file.

    var hideSidebarSubHead = document.querySelector('.sidebar h2, .sidebar h3');
    hideSidebarSubHead.style.display = 'none';


    ('.sidebar h2, .sidebar h3'): Here is class .sidebar and you have to update as per your classes

     

    If any issue let me know.

     

    Thank You

    Team

    1
  • Ifra Saqlain
    Community Moderator

    Another example:

    Step 1: Add jQuery library on document_head.hbs template.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

     

    Step 2: Copy this given code and paste at your script.js file at the bottom.

    $(document).ready(function (){
    $(".sidebar h2, .sidebar h3").hide(); // Update class name as per yours
    })

     

    Thanks

     

    1

Please sign in to leave a comment.

Powered by Zendesk