Skip to content

Instantly share code, notes, and snippets.

View hanuman6's full-sized avatar

Yoshihiro Fujita hanuman6

View GitHub Profile
[
{
"date": "2023.12.07",
"version": "1.0",
"build": "prod",
"name": "StoreApp",
"link": "./pkg/prod/store20211207prod.apk",
"comment": "本番レビュー用"
},
{
@hanuman6
hanuman6 / sample.md
Last active August 29, 2015 14:22
サンプル
@hanuman6
hanuman6 / .htaccess
Last active August 29, 2015 14:21
test環境ベーシック認証
# test_環境ベーシック認証
<Files ~ "^.(htpasswd|htaccess)$|(test_.*(\.php|\.html|\.jpg|\.png|\.gif)$)">
AuthUserFile /var/www/shop.buffaloes.co.jp/shopping/public_html/.htpasswd
AuthGroupFile /dev/null
AuthName "Input ID and Password."
AuthType Basic
require valid-user
order deny,allow
</Files>
@hanuman6
hanuman6 / index.php
Created December 5, 2013 22:00
ACFでカテゴリーに画像を設定して表示。※画像ID
<?php
$categories = get_categories();
//$categories = get_categories('parent=0'); 親カテゴリーのみ
foreach($categories as $category) :
$cat_id = $category->cat_ID;
$post_id = 'category_'.$cat_id;
$catimg = get_field('images',$post_id);
$img = wp_get_attachment_image_src($catimg, 'full');
@hanuman6
hanuman6 / style.css
Created December 5, 2013 17:45
Placeholderの色を変更
input[placeholder], [placeholder], *[placeholder] {
color: #9F9C9C!important;
}
@hanuman6
hanuman6 / new_gist_file.js
Created December 5, 2013 06:49
//高さを取得して画面いっぱいに画像サイズをあわせる
$('#top-photo').css('background-size', 'cover');
var wH = $(window).height();
//alert (wH);
$(function(){
$('#top-photo').css('height',wH+'px');
});
@hanuman6
hanuman6 / index.php
Created November 24, 2013 09:07
指定のタクソミーからタームを自動取得し一覧表示
<?php
$args = array(
'hideempty' => 1
);
$term_objs = get_terms('class',$args);
foreach ($term_objs as $term_obj) :
?>
<h3 class="terms"><?php echo esc_html($term_obj->name); ?></h3>
<?php
$args = array (
@hanuman6
hanuman6 / index.php
Created November 21, 2013 19:16
ログイン中のみ表示
<?php
if ( is_user_logged_in() ) {
echo 'ログイン中!';
} else {
echo 'ゲストさんようこそ';
};
?>
@hanuman6
hanuman6 / index.php
Created November 21, 2013 19:14
カスタムフィールドのセレクト表示のラベルを取得
<?php
$field = get_field_object('hogehoge');
$value = get_field('hogehoge');
$label = $field['choices'][ $value ];
?>
<p><?php echo $label; ?></p>
@hanuman6
hanuman6 / new_gist_file
Created November 21, 2013 17:58
カスタムフィールドの文字数を制限
<?php
$pattern = '/(^.{8})(.+)/u';
$subject = post_custom('shozichi_bp');
$matches = array();
preg_match($pattern, $subject , $matches);
if ($matches[2] != '') {
$out = $matches[1] . '';
} else {
$out = $subject;
}