'Primary Menu', 'footer-menu' => 'Footer Menu' ) ); } /*-----------------------------------------------------------------------------------*/ /* Load Menu Description /*-----------------------------------------------------------------------------------*/ class daq_Walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; $output .= $indent . '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); register_sidebar(array( 'name' => 'Footer Left', 'id' => 'footer-left-widget', 'description' => 'Left Footer widget position.', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => 'Footer Center One', 'id' => 'footer-centerone-widget', 'description' => 'Centre Footer widget position.', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => 'Footer Center Two', 'id' => 'footer-centertwo-widget', 'description' => 'Right Footer widget position.', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); register_sidebar(array( 'name' => 'Footer Right', 'id' => 'footer-right-widget', 'description' => 'Right Footer widget position.', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ' )); } /*-----------------------------------------------------------------------------------*/ /* Filters customize wp_title /*-----------------------------------------------------------------------------------*/ function daq_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'digitaladquest' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'daq_wp_title', 10, 2 ); /*-----------------------------------------------------------------------------------*/ /* Filters that allow shortcodes in Text Widgets /*-----------------------------------------------------------------------------------*/ add_filter('widget_text', 'shortcode_unautop'); add_filter('widget_text', 'do_shortcode'); add_filter('the_content_rss', 'do_shortcode'); /*-----------------------------------------------------------------------------------*/ /* Custom Gravatar Support /*-----------------------------------------------------------------------------------*/ if( !function_exists( 'daq_custom_gravatar' ) ) { function daq_custom_gravatar( $avatar_defaults ) { $daq_avatar = get_template_directory_uri() . '/images/gravatar.png'; $avatar_defaults[$daq_avatar] = 'Custom Gravatar (/images/gravatar.png)'; return $avatar_defaults; } add_filter( 'avatar_defaults', 'daq_custom_gravatar' ); } /*-----------------------------------------------------------------------------------*/ /* Custom Comments template /*-----------------------------------------------------------------------------------*/ function daq_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    comment_author_email, 70 ); ?>
    comment_approved == '0') : ?>
  • $length ){ $mytitle = substr($mytitle,0,$length); echo $mytitle . $after; } else { echo $mytitle; } } /*-----------------------------------------------------------------------------------*/ /* excerpt /*-----------------------------------------------------------------------------------*/ function daq_excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt); } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`[[^]]*]`','',$excerpt); return $excerpt; } /*-----------------------------------------------------------------------------------*/ /* nofollow to next/previous links /*-----------------------------------------------------------------------------------*/ function daq_pagination_add_nofollow($content) { return 'rel="nofollow"'; } add_filter('next_posts_link_attributes', 'daq_pagination_add_nofollow' ); add_filter('previous_posts_link_attributes', 'daq_pagination_add_nofollow' ); /*-----------------------------------------------------------------------------------*/ /* Nofollow to category links /*-----------------------------------------------------------------------------------*/ add_filter( 'the_category', 'daq_add_nofollow_cat' ); function daq_add_nofollow_cat( $text ) { $text = str_replace('rel="category tag"', 'rel="nofollow"', $text); return $text; } /*-----------------------------------------------------------------------------------*/ /* nofollow post author link /*-----------------------------------------------------------------------------------*/ add_filter('the_author_posts_link', 'daq_nofollow_the_author_posts_link'); function daq_nofollow_the_author_posts_link ($link) { return str_replace('', '")\' rel=\'nofollow\'>', $link ); } add_filter( 'comment_reply_link', 'daq_add_nofollow_to_reply_link' ); /*-----------------------------------------------------------------------------------*/ /* Removes Trackbacks from the comment count /*-----------------------------------------------------------------------------------*/ add_filter('get_comments_number', 'daq_comment_count', 0); function daq_comment_count( $count ) { if ( ! is_admin() ) { global $id; $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id)); return count($comments_by_type['comment']); } else { return $count; } } /*-----------------------------------------------------------------------------------*/ /* adds a class to the post if there is a thumbnail /*-----------------------------------------------------------------------------------*/ function has_thumb_class($classes) { global $post; if( has_post_thumbnail($post->ID) ) { $classes[] = 'has_thumb'; } return $classes; } add_filter('post_class', 'has_thumb_class'); /*-----------------------------------------------------------------------------------*/ /* Pagination /*-----------------------------------------------------------------------------------*/ function daq_pagination($pages = '', $range = 3) { $showitems = ($range * 3)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages){ $pages = 1; } } if(1 != $pages) { echo ""; } } /*-----------------------------------------------------------------------------------*/ /* Single Post Pagination /*-----------------------------------------------------------------------------------*/ function daq_wp_link_pages_args_prevnext_add($args) { global $page, $numpages, $more, $pagenow; if (!$args['next_or_number'] == 'next_and_number') return $args; $args['next_or_number'] = 'number'; if (!$more) return $args; if($page-1) $args['before'] .= _wp_link_page($page-1) . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '' ; if ($page<$numpages) $args['after'] = _wp_link_page($page+1) . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '' . $args['after'] ; return $args; } add_filter('wp_link_pages_args', 'daq_wp_link_pages_args_prevnext_add'); /*-----------------------------------------------------------------------------------*/ /* add button to tinymce /*-----------------------------------------------------------------------------------*/ add_filter('mce_buttons','daq_wysiwyg_editor'); function daq_wysiwyg_editor($mce_buttons) { $pos = array_search('wp_more',$mce_buttons,true); if ($pos !== false) { $tmp_buttons = array_slice($mce_buttons, 0, $pos+1); $tmp_buttons[] = 'wp_page'; $mce_buttons = array_merge($tmp_buttons, array_slice($mce_buttons, $pos+1)); } return $mce_buttons; } ?>