Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'init', 'woo_custom_child_actions', 10 );
- function woo_custom_child_actions () {
- // 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');
- } // woo_custom_child_actions()
- 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;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement