Ich möchte die Umschließenden <ul> und <li> Elemente eines Custom menüs entfernen.
Derzeit gibt
so etwas aus:
HTML
<ul id="" class="">
<li id="" class=""><a href=""></a></li>
<li id="" class=""><a href=""></a></li>
...
<li id="" class=""><a href=""></a></li>
</ul>
Ich hätte gerne
nur
Um meinem Ziel näher zu kommen habe ich
verwendet und in der funktions.php
das versucht:
PHP
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>';
// Since $output is called by reference we don't need to return anything.
$output .= apply_filters(
'walker_nav_menu_start_el'
, $item_output
, $item
, $depth
, $args
);
}
}
Alles anzeigen
das ergebniss ist
wie bekomme ich das schließende </li> nun noch weg?