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
{ | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"4GL", | |
"ACF Snippets", | |
"Alignment", | |
"All Autocomplete", |
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> | |
$(function() { | |
$('input[name=confirmprivacy]').change(function() { | |
var checked = $('input[name=confirmprivacy]').prop('checked'); | |
if (checked) { | |
$('#btn_confirmation').prop('disabled', false); | |
$('#btn_confirmation').css('background-color','#0065b3'); | |
} else { | |
$('#btn_confirmation').prop('disabled', true); | |
$('#btn_confirmation').css('background-color','#777'); |
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
1.home_url - 現在のブログのホームURLを取得する | |
<?php $home = home_url( '/' ); ?> | |
現在のブログ(サイト)のホームURLを取得する。ホームURLは、管理者ページの「設定」-「一般」の「サイトのアドレス(URL)」のこと。 | |
WordPress 3.0より前のバージョンではget_option( 'home' )やget_bloginfo( 'home' )を使用していたが、3.0以降ではこの関数を使うほうが望ましい(たぶん)。 | |
2.site_url - 現在のブログのサイトURLを取得する | |
<?php $site = site_url( '/' ); ?> | |
現在のブログ(サイト)のサイトURLを取得する。サイトURLは、管理者ページの「設定」-「一般」の「WordPressのアドレス(URL)」のこと。 |
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": "bs.2.0.1-sample", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "browser-sync start --server --files='./*.html, ./*.css'", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", |