add_filter('pre_option_link_manager_enabled','__return_true'); 后台注册链接选项
wp_list_bookmarks()获取友情链接
get_template_directory()是返回主题的绝对路径
get_template_directory_uri() 返回主题uri
bloginfo('template_directory');返回主题uri
wp_nav_menu( array( 'theme_location' => 'primary' , 'container_class' => 'menu') ); 获取导航菜单,参数指定一些导航样式
get_posts( "category=1&numberposts=8" ); 获取 所有文章
<ul>
<?php $posts = get_posts( "category=1&numberposts=8" ); ?>
<?php if( $posts ) : ?>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<li><span><?php the_time('m-d'); ?></span><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo cut_str($post->post_title,38); ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>