// Add custom Theme Functions here /* * Code bài viết liên quan theo chuyên mục */ function bvlq_danh_muc() { $output = ''; if (is_single()) { global $post; $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page'=>100, 'caller_get_posts'=>10 ); $my_query = new wp_query( $args ); if( $my_query->have_posts() ): $output .= '
'; $output .= '

Nội Dung Khác

'; while ($my_query->have_posts()):$my_query->the_post(); $output .= ''; endwhile; $output .= '
'; $output .= '
'; endif; //End if. wp_reset_query(); } return $output; } } add_shortcode('bvlq_danh_muc','bvlq_danh_muc'); if (function_exists('register_sidebar')){ register_sidebar(array( 'name'=> 'Sidebar 2', 'id' => 'sidebar_2', )) ; } ?>