任何问题请联系WX:uu16853

买模板送网站采集器 让你轻松放开双手运营网站!

购买更多有优惠!

调用最新日志的最简单方法

很多人想在自己的博客上显示最新的日志,可以通过一些很复杂的函数或者插件等等。但是今天向你介绍一个最简单的方法,通过 WordPress 内置的一个函数就可以实现。 函数如下: <ul> <?php get_archives(‘postbypost’, 10); ?> </ul> 第一个参数的是按一篇篇显示日志标题,第二个参数是显示的数量,这里显示10篇。默认情况下,他是输出在列表元素 (LI) 中,所以在它的前后加上 <ul> 和 </ul> 就成了一个完整的无序的列表了。 但是有个不好的地方就是如果你在最新日志页面上时,其最新日志列表还是包括当期那这篇日志。 更多关于 get_archives 请参考:TEMPLATE TAG/GET ARCHIVES 标签:WordPress 技巧

WordPress 技巧:调用置顶文章

有些时候我们需要调用 WordPress 置顶文章并单独显示出来,可以通过 WP_Query 来实现,代码如下: <?php $args = array( 'posts_per_page' => -1, 'post__in' => get_option( 'sticky_posts' ) ); $sticky_posts = new WP_Query( $args ); while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post();?> <li> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; wp_reset_query();?> 标签:WordPress 技巧

inent调用代码总结,不断完善中 Android开发技术

  来自网友整理的Intent,当然Android123将会加入更多内容不断完善Intent常见调用帮助网友方便查找。 显示Web网页:   1. Uri uri = Uri.parse("http://www.android123.com.cn");  2. Intent it = new Intent(Intent.ACTION_VIEW,uri);  3. startActivity(it); 显示Google地图:   1. Uri uri = Uri.parse("geo:38.899533,-77.036476");  2. Intent it = new Intent(Intent.Action_VIEW,uri);  3. startActivity(it); Maps路径规划:   1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");  2. Intent it = new Intent(Intent.ACTION_VIEW,URI);  3. startActivity(it); 拨打电话:   1. Uri uri = Uri.parse("tel:xxxxxx");  2. […]

inent调用代码总结,不断完善中 Android开发技术

  来自网友整理的Intent,当然Android123将会加入更多内容不断完善Intent常见调用帮助网友方便查找。 显示Web网页:   1. Uri uri = Uri.parse("http://www.android123.com.cn");  2. Intent it = new Intent(Intent.ACTION_VIEW,uri);  3. startActivity(it); 显示Google地图:   1. Uri uri = Uri.parse("geo:38.899533,-77.036476");  2. Intent it = new Intent(Intent.Action_VIEW,uri);  3. startActivity(it); Maps路径规划:   1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");  2. Intent it = new Intent(Intent.ACTION_VIEW,URI);  3. startActivity(it); 拨打电话:   1. Uri uri = Uri.parse("tel:xxxxxx");  2. […]

100% Secure Checkout

PayPal / MasterCard / Visa