20,359
社区成员
发帖
与我相关
我的任务
分享
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('First_sidebar') ) : ?>
<ul class="toc_section">
<?php
$args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($args);
foreach($categories as $category) {
echo ' <li>-';
echo ' <a href="' . get_category_link( $category->term_id ) . '">' . $category->name.' </a>';
echo ' </li>';
}
?>
</ul>
<?php endif; ?>
$wp_query = new WP_Query( array( 'cat' => array( $category->term_id ) ) );
if (have_posts() ) :
echo '<dl>';
while ( have_posts() ) : the_post();
echo '<dd><a href="/'.get_the_id().'.html">'.get_the_title().'</a></dd>';
endwhile;
echo '</dl>';
endif;
wp_reset_query();