__( 'Main Menu', 'groundwork' ) ) ); } add_action('comment_form_before', 'groundwork_enqueue_comment_reply_script'); function groundwork_enqueue_comment_reply_script() { if(get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_filter('the_title', 'groundwork_title'); function groundwork_title($title) { if ($title == '') { return 'Untitled'; } else { return $title; } } add_filter('wp_title', 'groundwork_filter_wp_title'); function groundwork_filter_wp_title($title) { return $title . esc_attr(get_bloginfo('name')); } add_filter('comment_form_defaults', 'groundwork_comment_form_defaults'); function groundwork_comment_form_defaults( $args ) { $req = get_option( 'require_name_email' ); $required_text = sprintf( ' ' . __('Required fields are marked %s', 'groundwork'), '*' ); $args['comment_notes_before'] = '

' . __('Your email is kept private.', 'groundwork') . ( $req ? $required_text : '' ) . '

'; $args['title_reply'] = __('Post a Comment', 'groundwork'); $args['title_reply_to'] = __('Post a Reply to %s', 'groundwork'); return $args; } add_action( 'init', 'groundwork_set_default_widgets' ); function groundwork_set_default_widgets() { if ( is_admin() && isset( $_GET['activated'] ) ) { update_option( 'sidebars_widgets', $preset_widgets ); } } add_action( 'init', 'groundwork_add_shortcodes' ); function groundwork_add_shortcodes() { add_filter('widget_text', 'do_shortcode'); add_shortcode('wp_caption', 'fixed_img_caption_shortcode'); add_shortcode('caption', 'fixed_img_caption_shortcode'); } function fixed_img_caption_shortcode($attr, $content = null) { $output = apply_filters('img_caption_shortcode', '', $attr, $content); if ( $output != '' ) return $output; extract(shortcode_atts(array( 'id'=> '', 'align' => 'alignnone', 'width' => '', 'caption' => ''), $attr)); if ( 1 > (int) $width || empty($caption) ) return $content; if ( $id ) $id = 'id="' . esc_attr($id) . '" '; return '
' . do_shortcode( $content ) . '

' . $caption . '

'; } add_action( 'widgets_init', 'groundwork_widgets_init' ); function groundwork_widgets_init() { register_sidebar( array ( 'name' => __('Sidebar Widget Area', 'groundwork'), 'id' => 'primary-widget-area', 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); } $preset_widgets = array ( 'primary-aside' => array( 'search', 'pages', 'categories', 'archives' ), ); function groundwork_get_page_number() { if (get_query_var('paged')) { print ' | ' . __( 'Page ' , 'groundwork') . get_query_var('paged'); } } function groundwork_catz($glue) { $current_cat = single_cat_title( '', false ); $separator = "\n"; $cats = explode( $separator, get_the_category_list($separator) ); foreach ( $cats as $i => $str ) { if ( strstr( $str, ">$current_cat<" ) ) { unset($cats[$i]); break; } } if ( empty($cats) ) return false; return trim(join( $glue, $cats )); } function groundwork_tag_it($glue) { $current_tag = single_tag_title( '', '', false ); $separator = "\n"; $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) ); foreach ( $tags as $i => $str ) { if ( strstr( $str, ">$current_tag<" ) ) { unset($tags[$i]); break; } } if ( empty($tags) ) return false; return trim(join( $glue, $tags )); } function groundwork_commenter_link() { $commenter = get_comment_author_link(); if ( ereg( ']* class=[^>]+>', $commenter ) ) { $commenter = preg_replace( '/(]* class=[\'"]?)/', '\\1url ' , $commenter ); } else { $commenter = preg_replace( '/(' . $commenter . ''; } function groundwork_custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $GLOBALS['comment_depth'] = $depth; ?>
  • >
    | | ', ''); ?>
    comment_approved == '0') { echo '\t\t\t\t\t'; _e('Your comment is awaiting moderation.', 'groundwork'); echo '\n'; } ?>
    __('Reply','groundwork'), 'login_text' => __('Login to reply.', 'groundwork'), 'depth' => $depth, 'before' => '' ))); endif; ?>
  • >
    | ', ''); ?>
    comment_approved == '0') { echo '\t\t\t\t\t'; _e('Your trackback is awaiting moderation.', 'groundwork'); echo '\n'; } ?>