Skip to content

Instantly share code, notes, and snippets.

@exmmth
exmmth / js hide page from uk-grid
Created March 3, 2023 11:55
this code hides current page block from grid blocks, uk-grid yootheme pro page builder
//hide current page from grid
let grid_class = 'fix-grid';//name of the grid class
if(document.querySelectorAll('.' + grid_class).length){
let cur_url = window.location.pathname,
grid_list = document.querySelectorAll('.' + grid_class +' > div > div');
Array.prototype.forEach.call(grid_list, function(el){
if(el.querySelectorAll('a')[0].getAttribute('href') == cur_url){
el.classList.add('uk-hidden');
}