div img{vertical-align:bottom;}
http://d.hatena.ne.jp/kanonji/20101122/1290409864
2.28.2012
2.27.2012
2.26.2012
メニューリストに任意のクラスを追加
// メニューリストに任意のクラスを追加
function.phpに下記を追加
function add_nav_menu_custom_class( $sorted_menu_items ) {
$num = 1;
foreach ( $sorted_menu_items as $key => $sorted_menu_item ) {
$sorted_menu_items[$key]->classes[] = 'menu-order-' . $num;
if ( $num == 1 ) {
$sorted_menu_items[$key]->classes[] = 'tip';
} elseif ( $num == count( $sorted_menu_items ) ) {
$sorted_menu_items[$key]->classes[] = 'tip';
}
$num++;
}
return $sorted_menu_items;
}
add_filter( 'wp_nav_menu_objects', 'add_nav_menu_custom_class' );
function.phpに下記を追加
function add_nav_menu_custom_class( $sorted_menu_items ) {
$num = 1;
foreach ( $sorted_menu_items as $key => $sorted_menu_item ) {
$sorted_menu_items[$key]->classes[] = 'menu-order-' . $num;
if ( $num == 1 ) {
$sorted_menu_items[$key]->classes[] = 'tip';
} elseif ( $num == count( $sorted_menu_items ) ) {
$sorted_menu_items[$key]->classes[] = 'tip';
}
$num++;
}
return $sorted_menu_items;
}
add_filter( 'wp_nav_menu_objects', 'add_nav_menu_custom_class' );
2.25.2012
wordpress ヘッダーのタグ整理
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
2.24.2012
wordpress 抜粋関連
the_excerpt() と the_content()
http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/the_excerpt
http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/the_excerpt
wordpress 記事タイトルの表示文字数制限
http://seno.cc/archives/264
<?php
$posts = get_posts('numberposts=3&order=desc'); ?>
<ul>
<?php foreach($posts AS $post): ?>
<li><A href="<?php the_permalink(); ?>"">
<?php
echo mb_substr($post->post_title, 0, 17).'...'; ?>
</a>
</li> <?php endforeach; ?>
</ul>
wordpress title属性削除
プラグイン
Remove Title Attributes
修正
http://netbizknowhow.seesaa.net/article/219044628.html
preg_replace('` title="(.+)"`',
部分を下記へ
preg_replace('/ title=[\"\'](.+?)[\"\']/u',
(情報元)
http://blog.we-boxes.com/wordpress/remove-title-attributes-the-category-bug-fix/
Remove Title Attributes
修正
http://netbizknowhow.seesaa.net/article/219044628.html
preg_replace('` title="(.+)"`',
部分を下記へ
preg_replace('/ title=[\"\'](.+?)[\"\']/u',
(情報元)
http://blog.we-boxes.com/wordpress/remove-title-attributes-the-category-bug-fix/
2.23.2012
カスタム投稿 サイド 月別アーカイブ
“function.php”
global $my_archives_post_type;
add_filter( 'getarchives_where', 'my_getarchives_where', 10, 2 );
function my_getarchives_where( $where, $r ) {
global $my_archives_post_type;
if ( isset($r['post_type']) ) {
$my_archives_post_type = $r['post_type'];
$where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
} else {
$my_archives_post_type = '';
}
return $where;
}
add_filter( 'get_archives_link', 'my_get_archives_link' );
function my_get_archives_link( $link_html ) {
global $my_archives_post_type;
if ( '' != $my_archives_post_type )
$add_link .= '?post_type=' . $my_archives_post_type;
$link_html = preg_replace("/href=\'(.+)\'\s/","href='$1".$add_link."'",$link_html);
return $link_html;
}
“sidebar.php
global $my_archives_post_type;
add_filter( 'getarchives_where', 'my_getarchives_where', 10, 2 );
function my_getarchives_where( $where, $r ) {
global $my_archives_post_type;
if ( isset($r['post_type']) ) {
$my_archives_post_type = $r['post_type'];
$where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
} else {
$my_archives_post_type = '';
}
return $where;
}
add_filter( 'get_archives_link', 'my_get_archives_link' );
function my_get_archives_link( $link_html ) {
global $my_archives_post_type;
if ( '' != $my_archives_post_type )
$add_link .= '?post_type=' . $my_archives_post_type;
$link_html = preg_replace("/href=\'(.+)\'\s/","href='$1".$add_link."'",$link_html);
return $link_html;
}
“sidebar.php
2.18.2012
2.16.2012
2.14.2012
2.12.2012
2.07.2012
UI design
http://itpro.nikkeibp.co.jp/article/NEWS/20120206/380228/?ST=develop&mkjb&P=3
8)コンテンツに没入させる
新しいUIデザインが生まれている分野として同氏が注目しているのがモバイルデバイス。特にiPadには目が離せないという。同氏は、魅力的と感じたUIに共通する、二つの最近注目されているキーワードを紹介した。
その一つが「没入感」(immersive design)。これは、UIを見せることをできるだけ避けて、コンテンツに集中させる考えである。具体的には、何かを読もうとしたときに、周囲のボタンなどではなく、テキストそのものが見えるようにすること。UIデザイナーは新しいボタンや要素を加えることが仕事と考えがちなので戒めるべきとの教えだ。
9)コンテンツの誘導は“流れる”ように
写真5●移動性に優れているとして紹介されたiPadの写真管理アプリ
[画像のクリックで拡大表示]
もう一つのキーワードは「移動性に優れたデザイン」(fluid design)。これは、複数のコンテンツを扱う際に、その間の動きやトレーシングを残しておくという考え方を指す。
移動性に優れたデザインが解決できる問題は二つある。一つはナビゲーション。今いる場所と、どこに行こうとしているのかをはっきりさせることである。
8)コンテンツに没入させる
新しいUIデザインが生まれている分野として同氏が注目しているのがモバイルデバイス。特にiPadには目が離せないという。同氏は、魅力的と感じたUIに共通する、二つの最近注目されているキーワードを紹介した。
その一つが「没入感」(immersive design)。これは、UIを見せることをできるだけ避けて、コンテンツに集中させる考えである。具体的には、何かを読もうとしたときに、周囲のボタンなどではなく、テキストそのものが見えるようにすること。UIデザイナーは新しいボタンや要素を加えることが仕事と考えがちなので戒めるべきとの教えだ。
9)コンテンツの誘導は“流れる”ように
写真5●移動性に優れているとして紹介されたiPadの写真管理アプリ
[画像のクリックで拡大表示]
もう一つのキーワードは「移動性に優れたデザイン」(fluid design)。これは、複数のコンテンツを扱う際に、その間の動きやトレーシングを残しておくという考え方を指す。
移動性に優れたデザインが解決できる問題は二つある。一つはナビゲーション。今いる場所と、どこに行こうとしているのかをはっきりさせることである。
2.06.2012
css URLの折り返し
table.chart .url {
white-space: pre; /* CSS 2.0 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */
word-break:break-all;
word-wrap:break-word;
}
white-space: pre; /* CSS 2.0 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */
word-break:break-all;
word-wrap:break-word;
}
2.03.2012
2.01.2012
wordpress 記事内でphp実行
http://kachibito.net/wordpress/php-file-include-post.html
http://www.zasae.com/haya/2011/01/wordpress_shortcode_php_eval/
http://www.zasae.com/haya/2011/01/wordpress_shortcode_php_eval/
登録:
投稿 (Atom)