1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <b><font color="blue">奥运会开幕还有:</font> <font color="red"><span id="timeDate">载入天数...</span><span id="times">载入秒数...</span> <script type="text/javascript"><!-- var now = new Date(); function createtime(){ var grt= new Date("8/08/2008 20:00:00"); now.setTime(now.getTime()+250); days = (grt - now) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (grt - now) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (grt - now) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (grt - now) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = dnum+"天"; document.getElementById("times").innerHTML = hnum + ":" + mnum + ":" + snum; } setInterval("createtime()",250); // --></script> </font></b> |
用JS在你的网页上显示当前时间
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | <font color="red"><b> <script language="JavaScript"> <!-- tmpDate = new Date(); date = tmpDate.getDate(); month= tmpDate.getMonth() + 1 ; myyear= tmpDate.getYear(); year=(myyear > 200) ? myyear : 1900 + myyear; document.write(year); document.write("年"); document.write(month); document.write("月"); document.write(date); document.write("日 "); myArray=new Array(6); myArray[0]="星期日" myArray[1]="星期一" myArray[2]="星期二" myArray[3]="星期三" myArray[4]="星期四" myArray[5]="星期五" myArray[6]="星期六" weekday=tmpDate.getDay(); if (weekday==0 | weekday==6) { document.write(myArray[weekday]) } else {document.write(myArray[weekday]) }; hours = tmpDate.getHours(); minutes = tmpDate.getMinutes(); seconds = tmpDate.getSeconds(); times = "<font color=orange>" + ((hours >24) ? hours -12 :hours); times += ((minutes < 10) ? "<blink>:</blink>0" : "<blink>:</blink>") + minutes+"</font>"; times += (hours >= 12) ? "<b>PM</b>" : "<b>AM</b>"; document.write(times); // --> </script> </b></font> |
仿快车网DedeCms风格
WordPress内置模板条件判断函数
1 | <?php if ( is_home() ) { ?>//判断是否首页<?php } ?> |
1 | <?php if ( is_single() ) { ?>//判断是否文章页<?php } ?> |
1 | <?php if ( is_single('17') ) { ?>//判断是否ID为17的文章页<?php } ?> |
1 | <?php if ( is_single('Beef Stew') ) { ?>//判断标题是否为 Beef Stew 的文章页<?php } ?> |
1 | <?php if ( comments_open() ) { ?>//当前页是否允许回复<?php } ?> |
1 | <?php if ( pings_open() ) { ?>//是否开启 ping<?php } ?> |
1 | <?php if ( is_page() ) { ?>//是否是一个页面<?php } ?> |
1 | <?php if ( is_category() ) { ?>//判断是否为分类页面<?php } ?> |
1 | <?php if ( is_tag() ) { ?>//是否TAG页面;可以用 is_tag('tagname') 判断具体的TAG<?php } ?> |
1 | <?php if ( is_author() ) { ?>//是否某个用户的文章;可以加入用户ID,或用户名作为参数<?php } ?> |
1 | <?php if ( is_archive() ) { ?>//判断是否存档<?php } ?> |
1 | <?php if ( is_search() ) { ?>//判断是否搜索<?php } ?> |
1 | <?php if ( is_404() ) { ?>//判断是否404页面<?php } ?> |
1 | <?php if ( is_paged() ) { ?>//判断是否翻页<?php } ?> |
例如,一个只需要在首页显示的可以用一下语句解决:
1 2 3 | <?php if(is_home() && !is_paged()){?> ... <?php }?> |
一个不在首页显示的,例如“最近发表文章”的插件可以加一个
1 2 3 | <?php if(!is_home()){?> ... <?php }?>//避免首页内容和插件内容重复。 |
收藏自零号相册
WordPress 调用单个分类文章列表
1 | <h2><?php wp_list_categories('include=11&title_li=&style=none'); ?></h2> //输出 ID 为11的分类的标题 |
1 | <?php echo category_description(11); ?> //输出 ID 为11的分类的描述 |
1 | <?php query_posts('cat=11&showposts=5'); ?> //query_posts 给 The Loop 限定的条件是:显示5篇日志和分类 ID 为11,cat=-11代表的是把分类ID为11的文章去掉 |
1 | <?php while (have_posts()) : the_post(); ?> //The Loop 开始 |
1 | <li><a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a></li> //用列表的方式输出带有链接的文章标题 |
1 | <?php endwhile; ?> //The Loop 结束 |
可拖拽的LOGO
Icer Free Web Hosting提供免费100MB美国空间
=====================================
Free Hosting
* 100MB Space
* 2GB Bandwidth
* 10 Domains
* cPanel + Fantastico
* PHP + MySQL Support
* 10 MySQL Databases
* 10 Email Accounts
* 10 FTP Accounts
* INSTANT SETUP!
* 100% COMPLETELY FREE!
=====================================
* SIGNUP后,自动开通!
* 无AD
=====================================
地址:icer.in
这是我的推荐地址:http://icer.in/client/aff.php?aff=026
=====================================
备注:请不要放置违反中国和美国法律相关内容的站点
演示站点:FY907.COM