Support » Plugins and Hacks » Hacks » Add Breaks to WP Nav Menu

Add Breaks to WP Nav Menu

  • Hi after, searching for an answer on how to remove
    ul and li tags from a WP NAV MENU, I found this solution:

    $foot_nav = wp_nav_menu( array( 'container' => '', 'echo' => '0', 'theme_location' => 'registrations' ) );
    $foot_nav2 = preg_replace( array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $foot_nav );
    $foot_nav2 = preg_replace( array( '#<li[^>]*>#', '#</li>$#' ), '', $foot_nav2 );
    echo $foot_nav2;

    My only issue with this is I would like to add a BREAK after each link so the nav looks as follows:

    Link 1
    Link 2
    Link 3

    … how can I accomplish this? I tried to PM the OP but no way of doing so.

    Thanks for the help

Viewing 1 replies (of 1 total)
  • You can accomplish this with custom CSS, rather than tearing into theme files.

    Depending on how your theme sets things up, you can accomplish it something like this:

    #nav > ul > li {
       padding: 12px 0;

    You’ll need to take a look at your source code to see how your theme actually sets it up.

    Link to your site?

Viewing 1 replies (of 1 total)
  • The topic ‘Add Breaks to WP Nav Menu’ is closed to new replies.