This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.cp 文件到s3,并设置为public权限: | |
aws s3 cp images s3://adwords.yeahmobi.com/wp-content/themes/hanrm-cn/assets/images --recursive --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
2.递归删除s3上目录下的所以文件: | |
aws s3 rm --recursive s3://adwords.yeahmobi.com/wp-content/themes/hanrm-cn/assets/images/ | |
3.列出s3某个目录下的所以文件: | |
aws s3 ls s3://adwords.yeahmobi.com/wp-content/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* robots.txt | |
* | |
* @param string $output The output of the robots.txt file | |
* @return string $public If the site is public facing | |
*/ | |
function robots_mod( $output, $public ) { | |
$output .= "Disallow: /\n"; | |
return $output; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* robots.txt | |
* | |
* @param string $output The output of the robots.txt file | |
* @return string $public If the site is public facing | |
*/ | |
function robots_mod( $output, $public ) { | |
$output .= "Disallow: /wp-includes/\n"; | |
$output .= "Disallow: /wp-content/plugins/\n"; | |
$output .= "Allow: /\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
官方文档:https://developers.google.com/maps/documentation/javascript/interaction?hl=zh-cn | |
<script> | |
/** | |
* Google Map | |
*/ | |
function initMap() { | |
var uluru = {lat: 34.318877, lng: 108.948488}; | |
var map = new google.maps.Map(document.getElementById('c_map'), { | |
center: uluru, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Making jQuery Google API | |
function modify_jquery() { | |
if (!is_admin()) { | |
// comment out the next two lines to load the local copy of jQuery | |
wp_deregister_script('jquery'); | |
} | |
} | |
add_action('init', 'modify_jquery'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete System Jquery | |
function delete_jquery() { | |
if ( is_admin() ) return; | |
wp_deregister_script('jquery'); | |
} | |
add_action('wp_enqueue_scripts', 'delete_jquery'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The posts | |
*/ | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$post_news = new WP_Query(array( | |
'post_type' => 'post', | |
'category_name' => 'news', | |
'posts_per_page' => 1, | |
'post_status' => 'publish', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The pagenation | |
* @info 每页显示数量设置:设置->阅读->博客页面至多显示 | |
*/ | |
the_posts_pagination( array( | |
'prev_text' => '«', | |
'next_text' => '»', | |
) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_cache_path /var/nginx/cache/aws/trueniu levels=2:2:2 use_temp_path=off keys_zone=aws_3:500m inactive=30d max_size=10g; | |
server { | |
listen 80; | |
server_name trueniu.com www.trueniu.com; | |
if ( $scheme = http ) { | |
return 301 https://www.trueniu.com$request_uri; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################ | |
## 安装Nginx | |
############################ | |
首先安装必要的库(nginx 中gzip模块需要 zlib 库,rewrite模块需要 pcre 库,ssl 功能需要openssl库)。选定/usr/local为安装目录,以下具体版本号根据实际改变。 | |
1.安装PCRE库 | |
$ cd /usr/local/ | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz | |
$ tar -zxvf pcre-8.38.tar.gz | |
$ cd pcre-8.38 |