Advertisement
richardmhowell

functions.php Child Edited

Mar 21st, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.  
  3. add_action( 'init', 'woo_custom_child_actions', 10 );
  4.  
  5. function woo_custom_child_actions () {
  6.  
  7.     // Remove main nav from the woo_header_after hook
  8.     remove_action('woo_header_after','woo_nav');
  9.  
  10.     // Add main nav to the woo_header_inside hook
  11.     add_action('woo_header_inside','woo_nav');
  12.  
  13. } // woo_custom_child_actions()
  14.  
  15. function woo_custom_nav_menu_start_el( $item_output, $item, $depth, $args ) {
  16.  
  17.     if ( $args->theme_location == 'primary-menu' ) {
  18.         $description  = '';
  19.         if ( ! empty( $item->description ) && ( $depth == 0 ) ) {
  20.             $description = '<span class="description">' . esc_attr( $item->description ) . '</span>';
  21.         }
  22.  
  23.         // Get the description to sit inside the anchor tag.
  24.         $item_output = str_replace( '</a>', $description . '</a>', $item_output );
  25.     }
  26.  
  27.     return $item_output;
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement