Article Template - Sidebar to show only H1 headings
I want my articles sidebar to show only H1 headings and not the H2/H3. Any idea how? Looking for an exact snipped that I can add in my template. Thank you!
-
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 classesIf any issue let me know.
Thank You
-
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
Please sign in to leave a comment.
2 Comments