Un usuario preguntó 👇
Hola,
Estoy intentando agregar el atributo de título a un elemento del menú, pero no es visible. ¿Existe un script que elimine el atributo de título de los enlaces?
Autor del tema
(@nobita)
Hace 3 años, 2 meses
Hola @snowme
El núcleo de WordPress no muestra el atributo de título del elemento de enlace con información sobre herramientas.
por favor intente con el siguiente código.
agregar functions.php
<?php
add_filter( 'nav_menu_link_attributes', 'my_nav_menu_attr_add', 10, 3 );
function my_nav_menu_attr_add( $atts, $item, $args ) {
if ( ! empty( $item->attr_title ) ) {
/**
* Add title attribute for a element
*/
$atts['attr_title'] = esc_attr( $item->attr_title );
/**
* Raindrops
* To display the value of the title attribute with the tooltip with the a element,
* the raindrops theme needs the tooltip class.
*/
$atts['class'] = 'tooltip';
return $atts;
}
return $atts;
}
?>
y requiere una configuración de cambio de tema
Personalizar / Presentación / Menú /
Menú fijo No.
Guardar y publicar
Gracias.
(@snowme)
Hace 3 años, 2 meses
Gracias Nobita.
¿Solucionó tu problema??
0 / 0