'
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); } //注册自定义菜单 if ( function_exists('register_nav_menus') ) { register_nav_menu( 'first', '页首菜单' ); register_nav_menu( 'second', '第二菜单' ); } //nav.php内的cats和tags的选择 function switchCatOrTag($w){ switch($w){ case 'cat': echo ''; break; case 'tag': wp_tag_cloud('format=list&smallest=8&largest=8'); break; case 'custom': wp_nav_menu( array( 'theme_location' => 'second', 'container' => '', 'items_wrap' => '' ) ); break; default: echo ''; } } //_get function _get($str){ $val = !empty($_GET[$str]) ? $_GET[$str] : null; return $val; } //_cookie function _cookie($str){ $val = !empty($_COOKIE[$str]) ? $_COOKIE[$str] : null; return $val; } //postClass function postClasses(){ $str = 'story solo'; if( is_single() || is_page() ){ $str .= 'only-story'; } echo post_class($str); } //评论区设置 function interjc_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    ' ); ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
  • id="li-comment-">
    < || > -> >'; $rules = explode('||', $words); foreach($rules as $rule) { $word = explode('->', trim($rule)); if(isset($word[1])) $incoming_comment['comment_content'] = str_replace(trim($word[0]), trim($word[1]), $incoming_comment['comment_content']); } return $incoming_comment; } add_filter( 'preprocess_comment', 'dali_conents_replace' ); /* Plugin Name: Category Posts Widget Author URI: http://jameslao.com/ */ class shadowBlueCategoryPosts extends WP_Widget { function shadowBlueCategoryPosts() { parent::WP_Widget(false, $name='分类文章',$widget_ops = array ('description' => '显示某些分类下的文章')); } /** * Displays category posts widget on blog. */ function widget($args, $instance) { global $post, $wp_query; extract( $args ); // If not title, use the name of the category. if( !$instance["title"] ) { $category_info = get_category($instance["cat"]); $instance["title"] = $category_info->name; } // Get array of post info. $cat_posts = new WP_Query("showposts=" . $instance["num"] . "&cat=" . $instance["cat"]); echo $before_widget; // Widget title echo $before_title; if( (bool) $instance["title_link"] ) echo '' . $instance["title"] . ''; else echo $instance["title"]; echo $after_title; // Post list echo "