Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*-----------------------------------------------------------------------------------*/
- /* You can add custom functions below */
- /*-----------------------------------------------------------------------------------*/
- // Remove main nav from the woo_header_after hook
- remove_action('woo_header_after','woo_nav');
- // Add main nav to the woo_header_inside hook
- add_action('woo_header_inside','woo_nav');
- add_filter( 'walker_nav_menu_start_el', 'woo_custom_nav_menu_start_el', 10, 4 );
- function woo_custom_nav_menu_start_el( $item_output, $item, $depth, $args ) {
- if ( $args->theme_location == 'primary-menu' ) {
- $description = '';
- if ( ! empty( $item->description ) && ( $depth == 0 ) ) {
- $description = '<span class="description">' . esc_attr( $item->description ) . '</span>';
- }
- // Get the description to sit inside the anchor tag.
- $item_output = str_replace( '</a>', $description . '</a>', $item_output );
- }
- return $item_output;
- } // End woo_custom_nav_menu_start_el()
- /*-----------------------------------------------------------------------------------*/
- /* Don't add any code below here or the sky will fall down */
- /*-----------------------------------------------------------------------------------*/
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement