Add custom ul class
-
Nice plugin! It seems useful to have an easy place to set the ul class. The needed changes to the plugin are below (pre-existing code is in italics, to give context).
<em>$this->defaults = array( 'save_format' => 'id', 'allow_null' => 0,</em> 'ul_class' => 'menu', <em>'container' => 'div' );</em>
<tr class="field_option field_option_<?php echo $this->name; ?>"> <td class="label"> <label><?php _e("ul class",'acf'); ?></label> <p class="description">Class for Menu's ul</p> </td> <td> <?php do_action('acf/create_field', array( 'type' => 'text', 'name' => 'fields['.$key.'][ul_class]', 'value' => $field['ul_class'], )); ?> </td> </tr>
<em>wp_nav_menu( array( 'menu' => $value, 'container' => $field['container'],</em> 'menu_class' => $field['ul_class'] <em>) );</em>
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
https://www.ads-software.com/extend/plugins/advanced-custom-fields-nav-menu-field/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add custom ul class’ is closed to new replies.