• Hi,
    I have a personalized theme and use HTML5.
    In validator, the div tag isn’t allowed with as a child of element ul and I try to remove this with the options and the PHP function and isn’t worked. I used regex to try this, but can’t work. The div appears on HTML, with the class option in blank.
    Can someone help me?

    <?php
    $menu = wp_page_menu(array(
    	'container' => '',
    	'container_class' => false,
    	'menu_class' => '',
    	'sort_column' => 'menu_order',
    	'exclude' => '5,9,23',
    	'show_home' => 1
    ));
    echo preg_replace( array( '#^<div[^>]*>#', '#</div>$#' ), '', $menu );
    
    ?>

    Thanks,

The topic ‘Remove div from menu’ is closed to new replies.