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
<!doctype html> | |
<html lang="ja-JP"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>DmP03 template</title> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> | |
<script> | |
// ここにコードを書きましょう! | |
</script> | |
</head> |
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
// ============================================================================= | |
// 指定された固定ページの親子関係か否か | |
// ============================================================================= | |
function _in_page($val = ""){ | |
global $post; | |
$valArr; | |
$val = preg_replace('/\/$/', '', $val); | |
$val = preg_replace('/^\//', '', $val); | |
$valArr = preg_split("/\//", $val); |
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
ini_set('display_errors', 0); // 画面へのエラー非表示 | |
ini_set("log_errors", 1); // エラーログ出力 | |
ini_set('error_log','/home/sites/heteml/users86/y/o/k/yokotakenji/web/log/wp-content/themes/log2015/log/debug.log'); // エラーログのパス指定 | |
// ob_start(); // バッファへの出力を開始 | |
// var_dump("dddd"); // ダンプして | |
// $cnt = ob_get_contents(); // バッファ内容を取得して | |
// ob_end_clean(); // バッファ終了 : 終了と同時にバッファが消されるので注意 | |
// error_log($cnt); // エラーログとして出力 | |
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
// register_post_type ↓ | |
// http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/register_post_type | |
// taxonomiesは省略しています。追加するかregister_taxonomy()を利用してください。 | |
add_action('init', 'custom_post'); | |
function custom_post(){ | |
$label_arr = array( | |
// 'name' => '', // 投稿タイプの一般名、通常は複数形。省略すると $post_type_object->label と同じ値になる。 | |
// 'singular_name' => '', // この投稿タイプのオブジェクト 1 個の名前(単数形)。デフォルトは 'name' の値。 | |
// 'menu_name' => '', // メニュー名のテキスト。メニュー項目の名前を決める文字列です。デフォルトは 'name' の値。 | |
// 'name_admin_bar' => '', // 管理バーの「新規追加」ドロップダウンに入れる名前。デフォルトは、'singular_name' があればその値になり、無ければ 'name' の値になる。 |
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
// register_taxonomy ↓ | |
// http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/register_taxonomy | |
add_action('init','custom_tax'); | |
function custom_tax(){ | |
$label_arr = array( | |
'name' => '', // タクソノミーの一般的な名前(普通は複数形)。 $tax->label によって上書きされて同じになる。デフォルトは _x( 'Post Tags', 'taxonomy general name' ) または _x( 'Categories', 'taxonomy general name' ) 。この文字列を国際化するときは、gettext context を使用してカスタム投稿タイプに合わせてください。例: _x('Writers', 'taxonomy general name'); | |
'singular_name' => '', // タクソノミーのオブジェクト 1 個の名前(単数形)。デフォルトは _x( 'Post Tag', 'taxonomy singular name' ) または _x( 'Category', 'taxonomy singular name' ) 。この文字列を国際化するときは、gettext context を使用してカスタム投稿タイプに合わせてください。例: _x('Writer', 'taxonomy singular name'); | |
'menu_name' => '', // メニュー名の文字列。メニュー項目の名前になります。無指定の場合、デフォルトで name のラベルが入ります。 | |
'all_items' => '', // 「すべての項目」の文字列。デフォルトは __( 'All Tags' ) または __( 'All Categories' ) | |
'edit_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
// | |
// singleton pattern | |
// | |
var Singleton = (function(){ | |
var instance; | |
return function(){ | |
if(instance){ | |
return instance; | |
}; |
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
//ex -> the_root_category(get_the_category(),"span"); | |
function the_root_category($cat,$mode="li"){ | |
$cat = get_root_category($cat); | |
$cnt = count($cat); | |
$_cat; | |
for($i = 0;$i<$cnt;$i++){ | |
echo "<".$mode." class='catGroup catGroup".$i." ".$cat[$i]->slug."'>".$cat[$i]->name."</".$mode.">"; | |
} | |
}; |
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
// welcart 拡張プラグイン WCEX Mobile | |
// http://www.welcart.com/archives/1626.html | |
// $wcmbのプロパティで環境ごとの分岐ができそうだったのでメモ | |
// ガラケーかどうかの判定っぽい。返り値はintかboolian | |
// PCで0:int スマホで10:int ガラケーでtrue:bool | |
$wcmb['check_garak'] | |
// デバイスの名前が入ってる | |
// PCだとPC:string スマホ、ガラケーだと機種名 |
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
// 使い方は | |
// $arr = priceArr(usces_the_firstPrice('return')); | |
// みたいな感じ。 | |
// 返り値は配列。 | |
// 管理画面で税率は必ず指定しておくこと! | |
function priceArr($price=0){ | |
global $usces; | |
$pos = $usces->options; |
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
module.exports = function( grunt ) { | |
'use strict'; | |
// | |
// Grunt configuration: | |
// | |
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md | |
// | |
grunt.initConfig({ | |
// ------------------------------------ |
OlderNewer