web,direction,planning,graphicdesign

2011年12月13日火曜日

worpdressで同じ日の記事の日付を表示させる

<dl class="clearfix">
<?php
global $post;
?>
<?php
if($posts): foreach($posts as $post): setup_postdata($post); ?>
<dt><a href="<?php the_permalink(); ?>"><?php echo get_the_date(); ?></a></dt>
<dd><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dd>
<?php endforeach; endif;
?>
</dl>

2011年10月28日金曜日

CSS3 グラデーション

background: -moz-linear-gradient(left top, #990,
#c36 30%,
#f60 50%,
#000 70%,
#066); /* Firefox用 */
background: -webkit-gradient(linear, left top, right bottom, from(#990),
color-stop(0.3, #c36),
color-stop(0.5, #f60),
color-stop(0.7, #000),
to(#066)); /* Safari,Google Chrome用 */


参照
http://www.css-lecture.com/log/css3/css3-gradient.html

2011年9月2日金曜日

WordPress the_excerptで文字数・文末の変更

wp-content/plugins/wp-multibyte-patchの中のwpmp-config-sample.phpをwpmp-config.phpにリネーム。
$wpmp_conf['excerpt_mblength'] = 110;を任意に変更。

function.php

文字数変更
function new_excerpt_mblength($length) {
return 20;
}
add_filter('excerpt_mblength', 'new_excerpt_mblength');

文末変更

function new_excerpt_more($more) {
return '.....';
}
add_filter('excerpt_more', 'new_excerpt_more');

wordpress TinyMCE Advancedのエディタ画面のスタイルのカスタマイズ

/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css

でスタイルを変更

/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css

331行目付近から「Formats」以下を変更
管理画面も変更可

2011年7月19日火曜日

MT で記事のないカテゴリーだけ表示させないようにする

<MTTopLevelCategories sort_by="user_custom">
<MTHasNoParentCategory>
<mt:SetVarBlock name="cat_cnt"><$MTCategoryCount$></mt:SetVarBlock>
<mt:If name="cat_cnt" ne="0">
<li><a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></li>
</mt:If>
</MTHasNoParentCategory>
</MTTopLevelCategories>



<$MTCategoryCount$>が0じゃない場合( ne="0")で取得できる

フォロワー