<?php
/**
* Disables loading of complianz cookie banner and blocking of cookies
* while in Oxygen Builder. Uses early-firing compliance hook.
* simply checks the request for the ct_builder query var.
* */
add_filter(
'cmplz_site_needs_cookiewarning',
function ( $cookiewarning_required) {
$url = is_ssl() ? "https" : "http";
$url .= "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
//don't show cookie banner on page where the URL contains the parameter "ct_builder"
if ( strpos( $url, 'ct_builder' ) !== false ) {
$cookiewarning_required = false;
//to disable the cookieblocker, uncomment the following
define('CMPLZ_DO_NOT_BLOCK', true);
}
return $cookiewarning_required;
}
);
var HeaderMenu = document.getElementById('_header_contacto');
var tituloPagina = document.getElementById('titulo-pagina__cabecera');
var menuNaranja = document.getElementById('menu_Naranja');
var cabecera = document.getElementsByTagName("h1");
var logo = document.getElementById('imagen-logo');
var elTitulo = document.title;
var indice = elTitulo.indexOf(" ");
var DivMenu = document.getElementById('div-menu_corto');
//var DivMenu2 = document.getElementById('div_block-407-11');
//Retraso da carga do menu naranxa
document.addEventListener('click', function(e){
if(e.target.classList.contains('oxel_icon_button__container') ||
e.target.parentElement.classList.contains('oxel_icon_button__container')){
menuNaranja.style.display='none';
}
});
if(elTitulo.includes('Inicio')){
DivMenu.classList.add('fondo-menu');
//DivMenu2.classList.add('fondo-menu');
}else {
DivMenu.classList.remove('fondo-menu');
//DivMenu2.classList.remove('fondo-menu');
}
//Empezamos a cargar todo
document.addEventListener("DOMContentLoaded",function(event){
if(cabecera[1].classList.contains('ct-headline')){
cabecera[1].classList.add('oculto');
cabecera[1].classList.add('no_opaco');
}
if(!elTitulo.includes('Inicio')){
tituloPagina.textContent = elTitulo.substring(0, indice);
}
var toggleado = function(){
HeaderMenu.classList.toggle('oculto');
}
var bordeado = function(){
if(!elTitulo.includes('Inicio')){
HeaderMenu.classList.add('header-Border__bajo');
}
HeaderMenu.classList.remove('oculto');
menuNaranja.style.display='block';
}
//toggleado();
setTimeout(toggleado, 500);
setTimeout(toggleado, 2300);
setTimeout(toggleado, 2600);
setTimeout(toggleado, 2900);
setTimeout(toggleado, 3200);
setTimeout(toggleado, 3500);
setTimeout(bordeado, 3800);
if (!elTitulo.includes('Inicio')){
setTimeout(function(){
logo.classList.add('girando')
} , 2000);
}
setTimeout(function(){
tituloPagina.classList.add('no_opaco');
cabecera[1].classList.remove('oculto');
cabecera[1].classList.add('formateado');
cabecera[1].classList.remove('no_opaco');
cabecera[1].classList.add('opaco');
}, 4500);
setTimeout(function(){
//cabecera[1].style.transform = "translateY(-75px)";
//logo.classList.add('delante1');
cabecera[1].classList.add('sube');
}, 5000);
})
/*
** Add Dropdown Pages Links to WordPress Admin Bar
*/
// Add Parent Link
function dplugins_toolbar_page_links($wp_admin_bar) {
$parent_menu_args = array(
'id' => 'dplugins-ct-pages',
'title' => 'Páginas',
'href' => site_url().'/wp-admin/edit.php?post_type=ct_template',
'meta' => array(
'class' => 'dplugins-ct-pages',
'title' => 'Páginas'
)
);
$wp_admin_bar->add_node($parent_menu_args);
// Add Pages List
$ct_pages = get_posts(array(
'post_type' => 'page',
'posts_per_page' => -1,
));
if($ct_pages){
foreach($ct_pages as $ct_page){
$ct_page_args = array(
'id' => 'dplugins-'.$ct_page->post_name,
'title' => $ct_page->post_title,
'href' => site_url().'/wp-admin/post.php?post='.$ct_page->ID.'&action=edit',
'parent' => 'dplugins-ct-pages',
'meta' => array(
'class' => 'dplugins-oxy-pages',
'title' => $ct_page->post_title,
)
);
$wp_admin_bar->add_node($ct_page_args);
}
}
}
add_action('admin_bar_menu', 'dplugins_toolbar_page_links', 999);