‘Wordpress’ 分类的存档
因为我的博客程序放在wordpress文件下面的不是放在网站根目录下的。所以就要转移啊!把WordPress放到单独它单独目录下的程序如下:1、新建一个用来存放WordPress核心文件的新文件夹(本例以/wordpress示范)。2、进入选项(options)面板。3、找到WordPress address (URL)(中文用户请查找”WordPress 地址(URL)“)...
给wordpress博客加上时间,其实很简单,简单的几行代码就行了,你可以在你想要加的地方加入就可以了. <?php $hourdiff = "0"; /* time difference, ex: "-8" or "8" */ $timeadjust = ($hourdiff * 60 * 60); $melbdate = date(&q...
相关的10篇文章 <ul> <?php $tags = wp_get_post_tags($post->ID); if ($tags) { $first_tag = $tags[0]->term_id; $args=array( 'tag__in' => array($first_tag), 'post__not_in' => array($post->ID), 'showposts'=>10, 'caller_get_posts'=>...
随机的10篇文章 <?php $rand_posts = get_posts('numberposts=10&orderby=rand'); foreach( $rand_posts as $post ) : ?> <li><a href="<?php the_permalink(); ?>"> < ?php the_title(); ?> </a></li> <?php endforeach; ?>特注明此...
最新的10篇评论 <?php global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER ...
留言数最多的10篇文章 <ul class="most_comments"> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 10"); foreach ($result as $post) { setup_postdata($post); $postid = $post->ID; ...
最新10篇文章 <?php global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JO...
我也修改了很多的主题,对主题中所写的一些数据库查询语句也有了一些认识!找出来给那些要修改主题的人!WordPress基本模板文件 style.css : CSS(样式表)文件 index.php : 主页模板 archive.php : Archive/Category模板 404.php : 404页面,错误页模板 comments.php : 留言/回复模板 ...
