wordpress

wordpress获取文章评论数及人数的方法

  • 2016-05-02
  • 阅读(838)
  • 评论(1)
  • ?php /** * 获取文章的评论人数 *$postid:文章id *$which:返回类型(0或1)为0时返回评论人数,为1时返回评论条数 */ function count_comments($postid=0,$which=0) { $comments = get_comments('status=approvetype ... ...

    wordpress获取文章评论数及人数的方法

    wordpress

    wordpress判断语句

  • 2016-05-01
  • 阅读(770)
  • 评论(0
  • is_single()判断是否是具体文章的页面is_single('2')判断是否是具体文章(id=2)的页面is_single('Beef Stew')判断是否是具体文章(标题判断)的页面is_single('beef-stew')判断是否是具体文章(slug判断)的页面com ... ...

    wordpress判断语句

    wordpress

    wordpress 非插件调用评论表情的方法

  • 2016-04-30
  • 阅读(692)
  • 评论(0
  • !–smilies– ?php function wp_smilies() { global $wpsmiliestrans; if (!get_option('use_smilies') or ( empty($wpsmiliestrans))) return; $smilies = array_unique($wpsmiliestrans); $link = ''; foreach ($s ... ...

    wordpress 非插件调用评论表情的方法

    wordpress

    wordpress调用网站统计大全

  • 2016-04-29
  • 阅读(714)
  • 评论(2
  • 1、日志总数:?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts-publish;?2、草稿数目:?php $count_posts = wp_count_posts(); echo $draft_posts = $count_posts-draft; ?3、评论总数 ... ...

    wordpress调用网站统计大全

    ?php global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved,comment_author_email, comment_type,comment_aut ... ...

    wordpress调用含gravatar头像的评论输出的方法

    wordpress

    wordpress去评论者链接的评论输出的方法

  • 2016-04-27
  • 阅读(712)
  • 评论(2
  • ?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(co ... ...

    wordpress去评论者链接的评论输出的方法

    wordpress

    wordpress调用指定分类文章的方法

  • 2016-04-26
  • 阅读(718)
  • 评论(0
  • category=4 这里定义分类的IDnumberposts=10 这里定义要调取的条数 ?php $posts = get_posts( "category=4numberposts=10" ); ? ?php if( $posts ) : ? ul?php foreach( $posts as $post ) : setup_postdata( $post ... ...

    wordpress调用指定分类文章的方法

    wordpress

    wordpress调用相关文章的方法

  • 2016-04-22
  • 阅读(721)
  • 评论(2
  • 在文章页显示相关文章 ?php $tags = wp_get_post_tags($post-ID); if ($tags) { $first_tag = $tags-term_id; $args = array( 'tag__in' = array($first_tag), 'post__not_in' = array($post-ID), 'showposts' = 10, ... ...

    wordpress调用相关文章的方法

    wordpress

    wordpress调用最新留言的方法

  • 2016-04-21
  • 阅读(650)
  • 评论(0
  • 下面是我之前在一个Wordpress主题中代到的最新留言代码,具体也记不得是哪个主题了。该代码直接调用数据库显示一份最新留言。其中 LIMIT 10限制留言显示数量。绿色部份则是每条留言的输出样式。 ?php global $wpdb; ... ...

    wordpress调用最新留言的方法

    wordpress

    wordpress调用随机文章的方法

  • 2016-04-20
  • 阅读(646)
  • 评论(0
  • ?php $rand_posts = get_posts(‘numberposts=10orderby=rand’); foreach( $rand_posts as $post ) : ? !–下面是你想自定义的Loop– lia href=”?php the_permalink(); ?”?php the_title(); ?/a/li ?php endforea ... ...

    wordpress调用随机文章的方法

    wordpress

    wordpress调用最新文章的方法

  • 2016-04-19
  • 阅读(799)
  • 评论(1
  • WordPress最新文章的调用可以使用一行很简单的模板标签wp_get_archvies来实现. 代码如下:?php get_archives(‘postbypost’, 10); ? (显示10篇最新更新文章)或者?php wp_get_archives(‘type=postbypostlimit=20for ... ...

    wordpress调用最新文章的方法

    wordpress

    Wordpres各种标签调用合集

  • 2016-04-18
  • 阅读(903)
  • 评论(1
  • /%postname%/ 显示博客的自定义永久链接?php the_search_query(); ? 搜索表单的值?php _e(‘Message’); ? 打印输出信息?php wp_register(); ? 显示注册链接?php wp_loginout(); ? 显示登入/登出链接!–next page– ... ...

    Wordpres各种标签调用合集

    wordpress

    WordPress 主体模板 PHP代码引用说明

  • 2016-04-15
  • 阅读(719)
  • 评论(0
  • ?php the_content(); ? 日志内容?php if(have_posts()) : ? 确认是否有日志?php while(have_posts()) : the_post(); ? 如果有,则显示全部日志?php endwhile; ? 结束PHP函数”while”?php endif; ? 结束PHP函数”if ... ...

    WordPress 主体模板 PHP代码引用说明

    wordpress

    WordPress Header头部 PHP代码引用说明

  • 2016-04-14
  • 阅读(690)
  • 评论(1
  • 注: 也就是位于head和/head之间的PHP代码?php bloginfo(‘name’); ? 网站标题?php wp_title(); ? 日志或页面标题?php bloginfo(‘stylesheet_url’); ? WordPress主题样式表文件style.css的相对地址?php bloginfo( ... ...

    WordPress Header头部 PHP代码引用说明

    wordpress

    wordpress 模板文件之间的调用

  • 2016-04-13
  • 阅读(850)
  • 评论(2
  • wordpress使用模板通过函数的调用,让模板之间形成完整的整体,例如在index.php中你会看到get_header()即调用文件名为header.php的模板文件, get_footer()亦然。get_template_part( 'loop', 'index' );则是调用模板 ... ...

    wordpress 模板文件之间的调用

    程序员电子书

    热门推荐

    友情链接