Skip to content

Instantly share code, notes, and snippets.

@nishinoshake
nishinoshake / include_tag.php
Created January 12, 2016 08:32
インクルードタグ
<?php get_header(); ?>
header.phpを読み込む
<?php get_sidebar(); ?>
sidebar.phpを読み込む
<?php get_footer(); ?>
footer.phpを読み込む
<?php comments_template(); ?>
@nishinoshake
nishinoshake / templete_tag_info.php
Last active May 29, 2016 04:31
テンプレートタグ
<?php bloginfo('name'); ?> 「一般設定」管理画面で指定したブログのタイトル
<?php bloginfo('description'); ?> 「一般設定」管理画面で指定したブログの説明文
<?php bloginfo('url'); ?> サイトURL
<?php bloginfo('stylesheet_url'); ?> 使用中のメインCSSファイルのURL
@nishinoshake
nishinoshake / getDayOfTheWeek.js
Created January 14, 2016 12:12
曜日を取得
var week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'][date.getDay()];
@nishinoshake
nishinoshake / animationend.js
Last active May 29, 2016 04:30
CSSアニメーションイベント
$elm.addClass('scale-up').on('webkitTransitionEnd.scale-up transitionend.scale-up',function() {
$(this).removeClass('scale-up').off('.scale-up');
});
@nishinoshake
nishinoshake / .htaccess
Last active May 29, 2016 04:47
SSIの有効化
#SSI
Options +Includes
AddType text/html html
AddHandler server-parsed html
@nishinoshake
nishinoshake / shiftjis_to_utf8.sh
Last active May 29, 2016 04:29
文字コードの変更
#UTF8に変換
nkf -w --overwrite readme.txt
@nishinoshake
nishinoshake / readme.txt
Last active May 29, 2016 04:29
ファイルを検索して削除
grep
-v 一致したものを除外
xargs
標準入力をパラメータにわたす
@nishinoshake
nishinoshake / get_thumbnail_url.php
Last active May 29, 2016 05:03
WordPressでサムネイルのURLを取得
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID()))[0];
@nishinoshake
nishinoshake / readme.txt
Last active May 29, 2016 04:28
カスタムフィールドのプラグイン
Advanced Custom Fields
表示名、key,valueを決めて入力するだけ。
本来カスタムフィールドはthe_metaみたいなので取ってくるけど、
ACFがfield()って関数を定義してくれてる。
display
<p><?php the_field('fieldname'); ?></p>
get
@nishinoshake
nishinoshake / readme.txt
Last active May 29, 2016 04:28
WordPressの引っ越し手順
1.FTPでWPの全ファイルをアップロード
2.SQLをエクスポート→インポート
3.パスが違うのでツールで一括置換する
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
4.パスワードを変更する