Advertisement
dprophit

theme functions

Jun 27th, 2013
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.83 KB | None | 0 0
  1. <?php
  2.  
  3. if ( function_exists( 'wp_nav_menu' ) ) {
  4. class description_walker extends Walker_Nav_Menu
  5. {
  6.       function start_el(&$output, $item, $depth, $args)
  7.       {
  8.            global $wp_query;
  9.            $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
  10.  
  11.            $class_names = $value = '';
  12.  
  13.            $classes = empty( $item->classes ) ? array() : (array) $item->classes;
  14.  
  15.            $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
  16.            $class_names = ' class="'. esc_attr( $class_names ) . '"';
  17.  
  18.            $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
  19.  
  20.            $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
  21.            $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
  22.            $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
  23.            $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
  24.  
  25.            $prepend = '';
  26.            $append = '';
  27.            $description  = ! empty( $item->description ) ? '<span class="descmenu">'.esc_attr( $item->description ).'</span>' : '';
  28.  
  29.            if($depth != 0)
  30.            {
  31.                      $description = $append = $prepend = "";
  32.            }
  33.  
  34.             $item_output = $args->before;
  35.             $item_output .= '<a'. $attributes .'>';
  36.             $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
  37.             $item_output .= $description.$args->link_after;
  38.             $item_output .= '</a>';
  39.             $item_output .= $args->after;
  40.  
  41.             $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
  42.             }
  43. }
  44. }
  45.  
  46.  
  47. $functions_path = TEMPLATEPATH . '/functions/';
  48. $includes_path = TEMPLATEPATH . '/includes/';
  49.  
  50. //Redirect admin to theme option upon activated
  51. require_once $functions_path . 'admin-setup.php';
  52.  
  53. //Theme Options
  54. require_once $functions_path . 'admin-options.php';
  55.  
  56. //Theme init
  57. require_once $includes_path . 'theme-init.php';
  58.  
  59. //Widget and Sidebar
  60. require_once $includes_path . 'sidebar-init.php';
  61.  
  62. require_once $includes_path . 'register-widgets.php';
  63.  
  64. //Additional function
  65. require_once $includes_path . 'theme-function.php';
  66.  
  67. //Additional function
  68. require_once $includes_path . 'shortcode.php';
  69.  
  70. //Loading jQuery
  71. require_once $includes_path . 'theme-scripts.php';
  72.  
  73. function bbp_enable_visual_editor( $args = array() ) {
  74.     $args['tinymce'] = true;
  75.     return $args;
  76. }
  77. add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
  78. // add_theme_support( 'qa_style' );
  79. // add_theme_support( 'qa_script' )
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement