Ich möchte bei einem Custom Menü die umschließende UL und die LI - Elemente entfernen.
Zum Verständnis:
gibt ja soetwas aus:
HTML
<ul>
<li id="xx" class="xx"><a href="">xx</a></li>
<li id="xx" class="xx"><a href="">xx</a></li>
...
<li id="xx" class="xx"><a href="">xx</a></li>
</ul>
Ich möchte nur so etwas:
Ich habe es Mittels
und einer function.php
PHP
class Mobile_Walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth, $args)
{
$output .= "";
$attributes = '';
! empty( $item->attr_title )
and $attributes .= ' title="' . esc_attr( $item->attr_title ) .'"';
! empty( $item->target )
and $attributes .= ' target="' . esc_attr( $item->target ) .'"';
! empty( $item->xfn )
and $attributes .= ' rel="' . esc_attr( $item->xfn ) .'"';
! empty( $item->url )
and $attributes .= ' href="' . esc_attr( $item->url ) .'"';
$title = apply_filters( 'the_title', $item->title, $item->ID );
$item_output = '<option value="'.$item->url.'">'
. $title
. '</option>';
$output .= apply_filters(
'walker_nav_menu_start_el'
, $item_output
, $item
, $depth
, $args
);
}
}
Alles anzeigen
Das folgende Ergebnis hin bekommen:
Wie entferne ich das schließende li?