wordpress-index.php基本框架代码 wordpress



//引入头部文件

<?php get_header();?>

<div id="main">

//循环开始

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

 

标题:<a href="<?php the_permalink() ?>"><?php the_title_attribute(); ?></a>

 

//调用文章内容:

<?php the_content("Read More..."); ?>

//调用文章内容摘要:

<?php the_excerpt("Read More..."); ?>

 

作者:<?php the_author_posts_link(); ?>

日期:<?php the_time('F d, Y') ?>

      <?php the_time('m-d') ?>//时间格式

 

评论调用:<?php comments_number('No Comment', '1 Comment', '% Comments' );?>

文章所属分类:标签:<?php the_category(', ') ?>


//上一页,下一页调用:

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

<div style="float:left"><?php previous_post_link('&laquo; %link'); ?></div>

<div style="float:right"><?php next_post_link('%link &raquo;'); ?></div>

</div> <!-- man ends here -->

 

//引入边栏

<?php get_sidebar();?>

//引入底部

<?php get_footer();?>



签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回