Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Problem is fixed. Here is the solution:</p> <blockquote> <p>functions.php</p> </blockquote> <pre><code>register_nav_menu( 'primary', __( 'Primary Menu') ); class Menu_With_Description extends Walker_Nav_Menu { function start_el(&amp;$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item-&gt;classes ) ? array() : (array) $item-&gt;classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . ' menu-button-bg"'; $output .= $indent . '&lt;li&gt;&lt;hr class="menu-dotted-line"/&gt;&lt;/li&gt;&lt;li id="menu-item-'. $item-&gt;ID . '"' . $value . $class_names .'&gt;'; $attributes = ! empty( $item-&gt;attr_title ) ? ' title="' . esc_attr( $item-&gt;attr_title ) .'"' : ''; $attributes .= ! empty( $item-&gt;target ) ? ' target="' . esc_attr( $item-&gt;target ) .'"' : ''; $attributes .= ! empty( $item-&gt;xfn ) ? ' rel="' . esc_attr( $item-&gt;xfn ) .'"' : ''; $attributes .= ! empty( $item-&gt;url ) ? ' href="' . esc_attr( $item-&gt;url ) .'"' : ''; $item_output = $args-&gt;before; $item_output .= '&lt;a'. $attributes .'&gt;'; $item_output .= '&lt;div class="menu-button"&gt;' . $args-&gt;link_before . apply_filters( 'the_title', $item-&gt;title, $item-&gt;ID ) . $args-&gt;link_after . '&lt;/div&gt;'; $item_output .= '&lt;div class="menu-button-desc"&gt;' . $item-&gt;description . '&lt;/div&gt;'; $item_output .= '&lt;/a&gt;'; $item_output .= $args-&gt;after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } } </code></pre> <blockquote> <p>jQuery</p> </blockquote> <pre><code>$(document).ready(function() { $("#logo-buttons-bg ul li:last").after("&lt;li&gt;&lt;hr class='menu-dotted-line'/&gt;&lt;/li&gt;"); } </code></pre> <blockquote> <p>header.php</p> </blockquote> <pre><code>&lt;?php $walker = new Menu_With_Description; ?&gt; &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'menu_class' =&gt; 'nav-menu', 'walker' =&gt; $walker, 'container' =&gt; false) ); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload