织梦调用wp博客文章和内容

2011-03-21 287 views

调用数据文章

第一种方法

{dede:sql sql=”SELECT * FROM wp_posts where post_status = ‘publish’ and post_type=’post’ order by post_date desc limit 0,10″}<li>
<a href=’[field:guid/]‘ target=’_blank’>[field:post_title /]</a></li>
{/dede:sql}

第二种方法

{dede:sql sql=”select *,id as post_id from wp_posts where post_status=’publish’ order by id desc limit 0,10″}
<li class=’dotline’><a href=’http://www.clseo.com/blog/?p=[field:post_id/]‘ target=’_blank’>[field:post_title/]</a></li>
{/dede:sql}

随机调用

{dede:sql sql=”SELECT * FROM wp_posts where post_status = ‘publish’ and post_type=’post’ order by rand() desc limit 0,100″}
<a href=’[field:guid/]‘ target=’_blank’>[field:post_title /]</a>
{/dede:sql}

//最新日志
post_date
//热评日志
comment_count
//随机日志
rand

Tags: , / Posted in 网站技术

转载请注明文章转载自:苏州seo [http://www.clseo.com]
本文链接地址:织梦调用wp博客文章和内容

欢迎订阅: Google Reader | 鲜果 | 抓虾 | 九点 | QQ邮箱 | 有道 | 更多


没有评论

  • (Required)
  • (Required, will not be published)

苏州seo | 苏州网络营销 | 百度搜索排名 | 网站关键词排名 | Sitemap
Design By CKSKY TEAM VERSION 3.0 苏ICP备11070793 © Copyright 2012 All Rights Reserved