Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There's commenting in the code and since it's all on one line, it's commented out the rest of the code. Fix your formatting.</p> <pre><code>&lt;?php // Activate menu function add_action('init', 'my_custom_menus'); function my_custom_menus() { register_nav_menus(array( 'main-menu' =&gt; 'Main Menu', 'footer-menu' =&gt; 'Footer Menu', 'top_menu' =&gt; 'Top Menu', 'resp_menu' =&gt; 'Responsive Menu' )); } // Main walker menu class Walker_Responsive_Menu extends Walker_Nav_Menu { function start_lvl(&amp;$output, $depth) { $indent = str_repeat("\t", $depth); // don't output children opening tag (`&lt;ul&gt;`) } function end_lvl(&amp;$output, $depth) { $indent = str_repeat("\t", $depth); // don't output children closing tag } function start_el(&amp;$output, $item, $depth, $args) { global $wp_query; $item_output = $attributes = $prepend = ''; // Create a visual indent in the list if we have a child item. $visual_indent = ( $depth ) ? str_repeat('&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;', $depth) : ''; // Load the item URL $attributes .=!empty($item-&gt;url) ? ' value="' . esc_attr($item-&gt;url) . '"' : ''; // If we have hierarchy for the item, add the indent, if not, leave it out. // Loop through and output each menu item as this. if ($depth != 0) { $item_output .= '&lt;option ' . $attributes . '&gt;' . $visual_indent . $item-&gt;title . '&lt;/option&gt;'; } else { $item_output .= '&lt;option ' . $attributes . '&gt;' . $prepend . $item-&gt;title . '&lt;/option&gt;'; } // Make the output happen. $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); } } class description_walker 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) . '"'; $output .= $indent . '&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) . '"' : ''; $prepend = '&lt;strong&gt;'; $append = '&lt;/strong&gt;'; $description = !empty($item-&gt;description) ? '&lt;span&gt;' . esc_attr($item-&gt;description) . '&lt;/span&gt;' : ''; if ($depth != 0) { $description = $append = $prepend = ""; } $item_output = $args-&gt;before; $item_output .= '&lt;a' . $attributes . '&gt;'; $item_output .= $args-&gt;link_before . $prepend . apply_filters('the_title', $item-&gt;title, $item-&gt;ID) . $append; $item_output .= $description . $args-&gt;link_after; $item_output .= '&lt;/a&gt;'; $item_output .= $args-&gt;after; $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); } } ?&gt; </code></pre>
 

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