<img src="sample.img" class="float"> <p class="text">祇園精舎の鐘の声<br> 諸行無常の響きあり<br> 沙羅双樹の花の色<br> 盛者必衰の理をあらわす<br> おごれる人も久しからず<br> ただ春の世の夢のごとし<br> たけき者も遂には滅びぬ<br> 偏に風の前の塵に同じ</p>
.float { float:left; } .text { overflow:auto; zoom:1; }
<img src="sample.img" class="float"> <p class="text">祇園精舎の鐘の声<br> 諸行無常の響きあり<br> 沙羅双樹の花の色<br> 盛者必衰の理をあらわす<br> おごれる人も久しからず<br> ただ春の世の夢のごとし<br> たけき者も遂には滅びぬ<br> 偏に風の前の塵に同じ</p>
.float { float:left; } .text { overflow:auto; zoom:1; }
http://milkveil.com/archives/963
アイコンと同じサイズのスタイル調整
.mtli_attachment { line-height: 48px; }
Link Manager
http://sharinglab.info/wordpress/wordpress-plug-in/seo/link-library/
http://www.d-31n.com/blog_archive/wp-template/3875
アドバンス
.blog_con img{ max-width: 300px; height: auto!important; width: auto!important; }
カジュアル
.blog_con img{ max-width: 300px; }
<?php /* Template Name: JCNEWS */ ?>
<?php //カテゴリーページでカテゴリー名を取得 りんくなし $cat_d = get_the_category(); $cat_d = $cat_d[0]; $cat_name_d = $cat_d->cat_name; echo $cat_name_d; ?>
上記 記事が無いとでないため
<?php single_term_title(); ?>
こっち
かてID2へのリンク
<a href="<?php echo get_category_link('2');?>">活動報告をもっと見る▶</a>
リンクつき記事のカテゴリ出力
<?php the_category(', '); ?>
pre_get_posts
http://notnil-creative.com/blog/archives/1688
議論になりすぎて作者も困惑
pre_get_postsの方が簡単にできることもある
日付日本語化 プラグ▶fields▶date
jquery.datetime.js
変更
出力
単発
echo date('Y年m月d日', strtotime($cfs->get('birthday')));
ループ未検証
<?php $loop = new WP_Query(array("post_type" => "schedule", "posts_per_page" => 1 )); while($loop->have_posts()): $loop->the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2><?php the_title(); ?></h2> <h3><?php echo $cfs->get('title'); ?></h3> <ul> <li><?php echo date('Y年m月d日', strtotime($cfs->get('date'))); ?></li> <li><?php echo $cfs->get('summary'); ?></li> </ul> <?php $fields = $cfs->get('Schedule'); foreach ($fields as $field) { ?> <h3><?php echo $field['title']; ?></h3> <ul> <li><?php echo date('Y年m月d日', strtotime($field['date'])); ?></li> <li><?php echo $field['summary']; ?></li> </ul> <?php } ?> </div> <?php endwhile; ?>
参考
http://brushape.com/wordpress/%E3%80%90wordpress%E3%80%91%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%82%92%E7%B0%A1%E5%8D%98%E4%BD%9C%E6%88%90%E3%81%97%E3%81%9F%E3%81%8F%E3%81%A6%E3%80%8Ccu/
スケジュール準備
未来記事表示 No Future Post
http://imasashi.net/blog/wordpress/future-info.html
もしっくは
ファンクション未検証http://istks.net/2300
function myfunc($data, $posts) { if ($data['post_status'] === 'future' && $posts['post_status'] === 'publish') { $data['post_status'] = 'publish'; } return $data; } add_filter('wp_insert_post_data', 'myfunc', 10, 2);
ループ みけん
<?php function filter_where($where = '') { $where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'"; return $where; } add_filter('posts_where', 'filter_where'); query_posts(array( 'cat' => ※記事カテゴリーID, 'order' => ASC, ));?> <?php if (have_posts()) : ?> <?while (have_posts()): the_post(); ?> ※ループ中身 <?php endwhile; ?> <?php else : ?> ※予定が無い場合のメッセージ <?php endif; ?>
カテゴリーページの場合みけん
<?php function filter_where($where = '') { $where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'"; return $where; } add_filter('posts_where', 'filter_where'); query_posts(array( 'cat' => get_query_var('cat'), 'order' => ASC, ));?>
アーカイブページみけん
<?php function filter_where($where = '') { $where .= " AND post_date > '" . date('Y-m-d', strtotime('1 days')) . "'"; return $where; } add_filter('posts_where', 'filter_where'); global $query_string; query_posts($query_string . "&order=ASC"); ?>
何日間とか指定
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/query_posts#.E6.97.A5.E6.99.82.E5.BC.95.E6.95.B0
何日から何日と指定
http://webcake.no003.info/webdesign/wp-queryposts-datesearch.html
記事が無い時ほかのページ みけん
http://ja.forums.wordpress.org/topic/21998?replies=5
本日の日付から過去30日間に書かれた最新記事を5件表示みけん
http://www.imamura.biz/blog/cms/wordpress/tips/8176
ignore_sticky_posts=1とは
http://mekemoke.jp/2012/10/428.html
検証結果===============
>< =><=がキーマン [php]function filter_where($where = '') {//フィルター $where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'";//AND post_date のあとの記号で未来過去をチェンジ return $where; } add_filter('posts_where', 'filter_where');[/php]
http://crossinthenight.com/wordpress/1710/
自動整形されるのを防ぎ意図どおりに改行する、プラグイン
「PS Disable Auto Formatting」
一度きりの自動整形解除プラグイン状態の「brBrbr」より、かなりおすすめ