true, 'ignore_sticky_posts' => true, 'post_type' => 'post' ) ); if ( !$query->have_posts() ) return __( '没有文章。', 'Bing' ); $month = null; $heading = Bing_get_main_list_title_tag(); $code = ''; while ( $query->have_posts() ) { $query->the_post(); if ( ( $current_month = get_the_date( 'Y-m' ) ) != $month ) { if ( $month ) $code .= ''; $month = $current_month; $code .= "<$heading>$month'; wp_reset_postdata(); return $code; } add_shortcode( 'archives', 'Bing_shortcode_archives' ); /** * 标签云简码 */ function Bing_shortcode_tags() { return wp_tag_cloud( 'echo=0&number=0' ); } add_shortcode( 'tags', 'Bing_shortcode_tags' ); /** * 友情链接简码 * * @since Beginning 4.1.0 */ function Bing_shortcode_links( $atts, $content, $shortcode ) { $pairs = array( 'menu' => null ); $atts = shortcode_atts( $pairs, $atts, $shortcode ); if ( !$items = wp_get_nav_menu_items( $atts['menu'] ) ) return __( '没有找到友情链接。', 'Bing' ); $code = ''; return $code; } add_shortcode( 'links', 'Bing_shortcode_links' ); // End of page.