广告位招租

六、制作分类页面category.php,以及分类页面sidebar

时间调用:

<?php the_time(‘Y-m-d h:m:s’) ?>

 

页面的标题:<?php wp_title(”);?>

 

分类列表调用:

<?php if ($posts_perpage) { ?>

<?php $postsperpage = $posts_perpage; ?>

<?php } else { ?>

<?php $postsperpage = 10; ?>

<?php } ?>

 

<?php

$categoryID=$cat;

$wp_query = new WP_Query(‘cat=’ . $categoryID. ‘orderby=date&order=desc&posts_per_page=’.$postsperpage.’&paged=’.$paged); ?>

 

 

 

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

<ul>

 

<li><span><?php the_date_xml(); ?></span><span></span><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></li>

 

</ul>

<?php endwhile; ?>

 

 

调用其他sidebar:

<?php include( TEMPLATEPATH . ‘/sidebar3.php’ ); ?>

 

最新文章;

<?php $rand_posts = get_posts(‘numberposts=6&orderby=date’);foreach($rand_posts as $post) : ?>

<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a><br/>

<?php endforeach;?>

 

随机文章:

<?php $rand_posts = get_posts(‘numberposts=6&orderby=rand’);foreach($rand_posts as $post) : ?>

<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a><br/>

<?php endforeach;?>

资源下载
资源下载
0
广告位招租

评论0

广告位招租
没有账号? 注册  忘记密码?