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
$wpload = sprintf('%s/wp-load.php', $_SERVER['DOCUMENT_ROOT']); | |
require_once($wpload); |
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
$args = array( | |
'post_type' => array( | |
'post', | |
), | |
'post_status' => array( | |
'publish', | |
), | |
'posts_per_page' => 5, | |
'order' => 'DESC', | |
'orderby' => 'date', |
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
■コンテンツ側 | |
<!--nextpage--> | |
■php側 | |
<?php | |
# ページングタグを表示する所で設定 | |
wp_link_pages(); | |
-------- | |
c.f. |
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 after_title() { | |
echo '<p>これはタイトル下に表示される</p>'; | |
} | |
add_action( 'edit_form_after_title', 'after_title' ); | |
function after_editor() { | |
echo '<p>これはエディタ下に表示される</p>'; | |
} | |
add_action( 'edit_form_after_editor', 'after_editor' ); |
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 remove_default_post_screen_metaboxes() { | |
remove_meta_box( 'tagsdiv-post_tag' , 'post' , 'side' ); /* 投稿のタグ */ | |
} | |
add_action('admin_menu','remove_default_post_screen_metaboxes'); |
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
/etc/my.cnf | |
------------------------- | |
default-character-set=utf8 | |
character-set-server = utf8 | |
collation-server=utf8_general_ci | |
init_connect='SET collation_database = utf8_general_ci; SET collation_connection = utf8_general_ci' | |
skip-character-set-client-handshake | |
------------------------- | |
mysql> ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci |
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
grep $'\t' |
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
$nonce = wp_nonce_field('pagename', '_wpnonce', true, false); | |
<form> | |
{$nonce} | |
</form> | |
--------------------- | |
if(is_page('pagename') && isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'pagename')) { | |
# | |
} else { |
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
svn copy trunk branches/hogehoge | |
svn commit | |
→ リビジョン12345とする | |
# 〜〜〜 branchで作業、最終リビジョンは22222 | |
# BASEディレクトリにcd(svn mergeはパスを指定しないと作業ディレクトリを対象にしちゃうので) | |
cd ~/svn/hogeSVN | |
# 12345〜22222(≒ HEAD)の修正を trunk にマージ |
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
htpassword -d /tmp/passwd username |
OlderNewer