广告位招租

三、如何制作幻灯片和tab式新闻栏目

调用幻灯片js代码:

<script src="<?php bloginfo('stylesheet_directory'); ?>/flash.js"></script>

 

时间调用:、

<?php the_time('m-d') ?>

最新文章:

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

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

<?php endforeach;?>

 

随机文章:

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

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

<?php endforeach;?>

 

热门文章:

<?php

$post_num = 9; // 设置调用条数

$args = array(

‘post_password’ => ”,

‘post_status’ => ‘publish’, // 只选公开的文章.

‘post__not_in’ => array($post->ID),//排除当前文章

‘caller_get_posts’ => 1, // 排除置頂文章.

‘orderby’ => ‘comment_count’, // 依評論數排序.

‘posts_per_page’ => $post_num

);

$query_posts = new WP_Query();

$query_posts->query($args);

while( $query_posts->have_posts() ) { $query_posts->the_post(); ?>

<div class=”” style=”padding:3px 0px;”><div class=”f-left”><img src=”<?php bloginfo(‘template_directory’); ?>/img/head-mark3.gif” align=”middle” class=”img-vm” border=”0″/><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”>

<?php the_title(); ?></a></div><div class=”f-right”><?php the_time(‘m-d’) ?></div><div class=”clear”></div></div>

<?php } wp_reset_query();?>

1
广告位招租

评论0

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