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
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
<?php | |
global $product; | |
$downloads = $product->get_downloads(); | |
foreach( $downloads as $download ) : | |
?> | |
<a href="<?php echo $download['file']; ?>"><?php echo $download['name']; ?></a> | |
<?php endforeach; ?> |
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 | |
global $withcomments; | |
$withcomments = 1; | |
?> |
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 | |
global $post; | |
$args = array( | |
'posts_per_page' => 1, | |
'post_type' => 'product', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'term_id', | |
'terms' => $item->term_id, |
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
$thumbnail_info = get_post( get_post_thumbnail_id() ); | |
$thumbnail_info->post_excerpt; //图像说明 | |
$thumbnail_info->post_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
location /phone/ { | |
if (!-e $request_filename){ | |
rewrite ^/(.*)$ /phone/index.php last; | |
} | |
} | |
location /newtravel/ { | |
if (!-e $request_filename){ | |
rewrite ^/(.*)$ /newtravel/index.php last; | |
} | |
} |
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: get_terms | |
$args = array( | |
'taxonomy' => 'product_cat', | |
'hierarchical' => 1, | |
'show_option_none' => '', | |
'hide_empty' => 0, | |
'include' => '17,18,19,20', | |
'orderby' => 'term_id', | |
'order' => 'ASC' |
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
$thumbnail_id = get_woocommerce_term_meta($item->term_id, 'thumbnail_id', true); | |
$thumb = wp_get_attachment_url($thumbnail_id); | |
echo '<img src="'. $thumb .'" alt="'. $title .'">'; |
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
$products_tags = get_the_term_list($product_id, 'product_tag'); | |
echo $products_tags; |