miércoles, 27 de febrero de 2013

Añadir breadcrumbs (menú de navegación) en páginas y entradas de wordpress

En el functions:


// Insertar Breadcrumb  
function the_breadcrumb() {
if (!is_home()) {
echo '<a href="';
echo get_option('home');
       echo '">';
echo 'Inicio';
echo "</a> » ";
if (is_category() || is_single()) {
the_category('title_li=');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo the_title();
}
}
}  
// fin breadcrumb

y se agregan así:

<?php the_breadcrumb(); ?>

No hay comentarios:

Publicar un comentario