This file contains hidden or 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
jQuery(function ($) { | |
// name space | |
function LightUtils(options) { | |
var prop; | |
for (prop in this) { | |
if (LightUtils.prototype.hasOwnProperty(prop)) { | |
var res = this[prop](); | |
} | |
} | |
} |
This file contains hidden or 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
<!-- たにぐち まこと 「iPhone+Android スマートフォンサイト制作入門」ASCII --> | |
<script> | |
if (((navigator.userAgent.indexOf('iphone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPad') > 0 || navigator.userAgent.indexOf('Android') > 0) { | |
document.write('<link ref="stylesheet" href="phone.css">'); | |
} | |
</script> |
This file contains hidden or 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 | |
if (is_uploaded_file($_FILES["upfile"]["tmp_name"])) { | |
// echo $_FILES["upfile"]["name"] . "をアップロードしました。"; | |
// print('<img src="' . $_FILES["upfile"]["tmp_name"] . '">'); | |
echo $_FILES["upfile"]["tmp_name"]; | |
} else { | |
// echo "ファイルが選択されていません。"; | |
} | |
?> | |
<form action="index.php" method="post" enctype="multipart/form-data"> |
This file contains hidden or 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 if (is_page('foo')) : ?> | |
<p>foo</p> | |
<?php elseif (is_page('bar')) : ?> | |
<p>bar</p> | |
<?php else : ?> | |
<p>baz</p> | |
<? endif; ?> |
This file contains hidden or 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 | |
/** | |
* 入力エディタでbloginfoを取得する。 | |
* @param arg bloginfoの引数 | |
* url ブログのURL | |
* template_directory テンプレートディレクトリのパス | |
* stylesheet_directory テーマディレクトリのパス | |
* デフォルトではblogのURLを返す | |
*/ | |
function bloginfo_func($atts) { |
This file contains hidden or 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 | |
/** | |
* 属性numに指定した数の改行をマークアップ。 | |
* @attribute num 改行の数 | |
* 使い方[bar num="3"] 3回改行 | |
*/ | |
function br_func($atts) { | |
extract(shortcode_atts(array( | |
'num' => '1' | |
), $atts)); |
This file contains hidden or 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 | |
/** | |
* テンプレートディレクトリの画像を利用するショートコード。 | |
* @attribute src テンプレートディレクトリ以降の画像パス。先頭に/を含める | |
* @attribute alt 代替文字 | |
* @attribute id id名 | |
* @attribute class クラス名 | |
* @attribute width 幅 pxなし | |
* @attribute height 高さ pxなし | |
* @attribute type tagならimgタグを返す。 pathならパスを返す。 |
This file contains hidden or 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 | |
/** | |
* h1-h6に属性を指定してマークアップする | |
* @attribute id id名 | |
* @attribute class クラス名 | |
* 属性がない場合は下記のHTMLコードを返す | |
* <img src="%TEMPLATE_DIRECTORY%/screenshot.png" alt="*" /> | |
* %TEMPLATE_DIRECTORY%はbloginfo('stylesheet_directory') | |
* 使い方[h1 id="foo" class="bar"]Example[/h1] | |
*/ |
This file contains hidden or 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
/* ------------------------------------------------------------------- | |
general class | |
------------------------------------------------------------------- */ | |
.text-red { | |
color: #b74040; | |
} | |
.text-center { | |
text-align: center; | |
} | |
.text-right { |
This file contains hidden or 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 | |
/** | |
* 「このページの上へ」をマークアップするショートコード。 | |
* @attribute classname div要素のクラス名 省略 pagetop | |
* @attribute target アンカー名 省略 wrapper | |
* @attribute text リンクの文字列 このページの上へ。 | |
* 属性がない場合は下記のHTMLコードを返す。 | |
* <div class="pagetop"><a href="#wrapper">このページの上へ</a></div> | |
* 使い方[pagetop] | |
*/ |