This file contains 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
<snippet> | |
<content> | |
<![CDATA[ | |
target="_blank"]]> | |
</content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>@tar</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.html</scope> --> | |
</snippet> |
This file contains 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
{ | |
"auto_upgrade_last_run": null, | |
"installed_packages": | |
[ | |
"AutoFileName", | |
// HTMLファイルを編集中に画像ファイルを予測変換で選択できて、自動で幅・高さも補完される | |
//[Mac] Sublime Text2 > Preferences > Package Settings AutoFileName > Settings - Default | |
// [Win] Preferences > Package Settings AutoFileName > Settings - Default | |
// を開いて、23行目を | |
This file contains 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 | |
$map_address = get_post_meta($post -> ID, 'googlemap_address', true); | |
$map_marker = get_post_meta($post -> ID, 'googlemap_label', true); | |
// エスケープ | |
$map_address = esc_html( $map_address ); | |
// 全角英文字・数字など整形 | |
$map_address = mb_convert_kana( $map_address, "nKV", "UTF-8" ); |
This file contains 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
<script> | |
var map; | |
// 緯度を変数に代入 | |
var latitude = Number("<?php echo $latitude; ?>"); | |
// 経度を変数に代入 | |
var longitude = Number("<?php echo $longitude; ?>"); | |
// 倍率を変数に代入 |
This file contains 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 | |
$map_address = get_post_meta($post -> ID, 'googlemap_address', true); | |
$map_marker = get_post_meta($post -> ID, 'googlemap_label', true); | |
$map_address = esc_html( $map_address ); | |
$map_address = mb_convert_kana( $map_address, "nKV", "UTF-8" ); | |
$map_address = urlencode( $map_address ); | |
$api_uri = 'http://maps.googleapis.com/maps/api/geocode/json?address='. $map_address .'&sensor=false'; | |
$json = file_get_contents($api_uri, true); |
This file contains 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 | |
// カスタム投稿タイプ「新着記事(news)」 | |
add_action( 'init', 'news_custom_post_type' ); | |
function news_custom_post_type() { | |
$labels = array( | |
'name' => _x( '新着記事', 'post type general name' ), | |
'singular_name' => _x( '新着記事', 'post type singular name' ), | |
'add_new' => _x( '新しい新着記事を追加', 'news' ), | |
'add_new_item' => __( '新しい新着記事を追加' ), |
This file contains 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 | |
add_action( 'pre_get_posts', 'foo_modify_main_queries' ); | |
function foo_modify_main_queries ( $query ) { | |
if ( is_admin() || ! $query -> is_main_query() ) | |
return; | |
if ( $query -> is_home() ) { | |
$query -> set( 'post_type', 'post' ); // 投稿 | |
$query -> set( 'orderby', 'menu_order' ); // 指定順 |
This file contains 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 | |
add_post_type_support( 'post', 'page-attributes' ); |
This file contains 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 | |
function bar_modify_main_queries ( $query ) { | |
if ( is_admin() || ! $query -> is_main_query() ) | |
return; | |
if ( $query -> is_home() ) { | |
$query -> set( 'post_type', 'post' ); // 投稿 | |
$query -> set( 'orderby', array( 'menu_order' => 'DESC', 'date' => 'DESC' ) ); // 指定順を降順に |
This file contains 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
{ | |
"name": "project", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |