WordPress : Plugin Custom Global Variables

Fecha Publicación:       29 de Octubre de 2023
Fecha Modificación:       29 de Octubre de 2023

Crea tus propias variables personalizadas

→ Ir a la Página oficial de  https://es.wordpress.org/plugins/custom-global-variables/ 

Una vez instalado ir a AjustesCustom Global  Variables   

Modo de usar Plugin Custom Global Variables:

En el archivo functions.php podemos usarlo :  

 

/*-----------INICIO Agregar Whatsapp flotante en WordPress ------------------------------*/
add_action('wp_footer','dcms_add_footer_whatsapp');

function dcms_add_footer_whatsapp(){
	$tel = $GLOBALS['cgv']['celular1'];
	$ms = urlencode("Chatea con Nosostros");

	$url = "https://wa.me/${tel}?text=${ms}";
	//$img = get_stylesheet_directory_uri().'/wp-content/uploads/2022/07/whatsapp-icon.svg';
	$img ='/wp-content/uploads/2022/07/whatsapp-chat.png';
	echo "<div id='float-whatsapp' style='position:fixed;bottom:40px;right:40px;'>";
	echo " <a href=${url} target='_blank'>";
	echo " <img src='${img}' width=180 height=180 />";
	echo " </a>";
	echo "</div>";
}

/*-----------FIN Agregar Whatsapp flotante en WordPress ------------------------------*/

 

Articulo : 667 - Veces Leidas
Compartir Articulo:
×

¡Apóyame suscribiéndote a mi canal!

Tutoriales sobre Diseño Web