nginx配置location

指令作用匹配指定的请求uri(请求uri不包含查询字符串,如http://localhost:8080/test?id=10,请求uri是/test)语法形式location   [ = | ~ | ~* | ^~ | @]   /uri/     { configuration }匹配模式及顺序匹配字符串分为两种:普通字符串(literal string)和正则表达式(regular expre

- 阅读全文 -

wordpress调用随机文章最直接的用法

在需要的位置放入下面的代码。<?php $args = array( 'numberposts' => 5, 'orderby' => 'rand', 'post_status' => 'publish' ); $rand_posts = get_posts( $args ); foreach( $rand_posts as $post ) : ?> <

- 阅读全文 -

wordpress统计某个标签下的文章总数

function.php1、根据Tag的ID调用//根据标签ID获取文章数 function get_tag_post_count_by_id( $tag_id ) { $tag = get_term_by( 'id', $tag_id, 'post_tag' ); _make_cat_compat( $tag ); return $tag->count; }2、根据Tag的

- 阅读全文 -

WordPress如何给已发布文章批量添加TAG 标签

在当前网站的主题的functions.php里加上下面的代码;function naruco_mod_tags(){ $post_ids = array(1,2,3,4,5,6,7,8,9,10);//要加tag的文章id foreach( $post_ids as $k => $post_id ){ wp_set_post_tags( $post_id, array('做网站','建站培训

- 阅读全文 -

禁用WordPress缩略图自动裁剪

1、设置-媒体,全部设置为0;2、通过访问 你的域名/wp-admin/options.php 即可进入了WordPress的全部设置页面,把medium_large_size_w的值设置为0;3、可能主题里面有地方设置了剪切,这时候通过编辑器检索主题里的所有文件里的set_post_thumbnail_size和add_image_size函数,找到设置,把代码注释掉即可。

- 阅读全文 -

python3.5 html字符实体编码/解码

编码:import cgi def htmlescape(str): return(cgi.escape(str)) print(htmlescape("&"))解码def htmlunescape(str): h=HTMLParser() return(h.unescape(str)) print(htmlunescape("&

- 阅读全文 -