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
<h3>My Picture (1)</h3> | |
<input type="text" id="my_media_1" name="my_media_1" value="" /> | |
<a class="media-upload" href="JavaScript:void(0);" rel="my_media_1">Select File</a> | |
<h3>My Picture (2)</h3> | |
<input type="text" id="my_media_2" name="my_media_2" value="" /> | |
<a class="media-upload" href="JavaScript:void(0);" rel="my_media_2">Select File</a> |
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 | |
/* | |
Plugin Name: My Widget | |
*/ | |
add_action( | |
'widgets_init', | |
create_function('', 'return register_widget("MyWidget");') | |
); |
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 | |
// 以下のような感じで新しいrewrite_ruleを定義して。。。 | |
private $rule = array( | |
'archives/events/?$' | |
=> '?events=1', | |
'archives/events/([0-9]{4})/?$' | |
=> '?events=1&year=$matches[1]', | |
'archives/events/([0-9]{4})/([0-9]{1,2})/?$' |
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 | |
/* | |
Plugin Name: Super Simple OGP | |
Description: Setup OGP simply | |
Author: Takayuki Miyauchi | |
Version: 0.1 | |
*/ | |
new SUPER_SIMPLE_OGP(); |
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 twentyten_setup() { | |
add_editor_style(); | |
add_theme_support('post-thumbnails'); | |
add_theme_support('automatic-feed-links'); | |
load_theme_textdomain('twentyten', TEMPLATEPATH . '/languages'); | |
$locale = get_locale(); | |
$locale_file = TEMPLATEPATH . "/languages/$locale.php"; | |
if (is_readable($locale_file)) |
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 | |
/* | |
使い方: | |
[thumb url="http://exmaple.com/url/to/your/post" size="thumbnail"] | |
*/ | |
add_shortcode('thumb', 'shortcode_post_thumbnail'); | |
function shortcode_post_thumbnail($p){ | |
if (!isset($p['url']) || !$p['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
<?php | |
/* | |
Plugin Name: List Subpages | |
Author: @miya0001 | |
*/ | |
new listSubpages(); | |
class listSubpages { |
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 | |
/* | |
Plugin Name: Internal Links | |
Author: @miya0001 | |
*/ | |
new internalLinks(); | |
class internalLinks { |
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('wp_head', 'add_description'); | |
function add_description() { | |
$meta = '<meta name="description" content="%s" />'; | |
if (is_home() || is_front_page()) { | |
$site_description = get_bloginfo('description', 'display'); | |
if ($site_description) { | |
printf($meta, $site_description); | |
} |