• Hi,

    as you probably know you can edit the menu

    so this is the default:

    <?php $defaults = array(
      'theme_location'  => ,
      'menu'            => ,
      'container'       => 'div',
      'container_class' => ,
      'container_id'    => ,
      'menu_class'      => 'menu',
      'menu_id'         => ,
      'echo'            => true,
      'fallback_cb'     => 'wp_page_menu',
      'before'          => ,
      'after'           => ,
      'link_before'     => ,
      'link_after'      => ,
      'depth'           => 0,
      'walker'          => );
    ?>

    what if I want a seperation character | and i want to add a class. Can somebody give me the example?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The $after argument is what you’re after.

    <?php $defaults = array(
      'theme_location'  => ,
      'menu'            => ,
      'container'       => 'div',
      'container_class' => ,
      'container_id'    => ,
      'menu_class'      => 'menu',
      'menu_id'         => ,
      'echo'            => true,
      'fallback_cb'     => 'wp_page_menu',
      'before'          => ,
      'after'           => ' | ',
      'link_before'     => ,
      'link_after'      => ,
      'depth'           => 0,
      'walker'          => );
    ?>

    Items should get a dynamic class applied to them that you can style. Or you can always do .menu li if you want to style them all.

    Thread Starter baszer

    (@baszer)

    thank you,

    i got it after i posted it ??

    but no i have another problem. After the last menu item I dont want a ‘ | ‘ symbol.

    How to get rid of that?

    I thought you want something after the a tag?

    Just update

    'after'           => ' | ',

    to whatever you want. Leave it blank if you don’t want anything:

    'after'           => '',

    Oh nevermind, now I understand the question.

    Try doing it with css instead. Add a right border to all the items, and then remove it from the last one.

    Im sorry of all for my English.

    I have a problem with my jQuery + Css menu.

    demo: https://meqasigorta.az/11.html it’s work cool. but it dont work in my wordpress theme header.php

    https://meqasigorta.az/index2.php

    please help me….

    Thread Starter baszer

    (@baszer)

    Try doing it with css instead. Add a right border to all the items, and then remove it from the last one.

    how to remove the last border with css?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP Navigation’ is closed to new replies.