http://contactform7.com/ja/text-fields/
40×10
80x
x4
http://contactform7.com/ja/text-fields/
40×10
80x
x4
<?php
if(is_array(post_custom('shashu')))
{$shashu_all = post_custom('shashu');}
else
{$shashu_all = array(post_custom('shashu'));}
foreach($shashu_all as $shashu):
if ( $shashu == 'NA' ):?>
<span class="na_c icon_sb p95" >NA</span>
<?php elseif ( $shashu == 'NB' ):?>
<span class="nb_c icon_sb p95">NB</span>
<?php elseif ( $shashu == 'NC' ):?>
<span class="nc_c icon_sb p95">NC</span>
<?php endif;
endforeach; ?>
参考http://ooo-000-ooo.com/wordpress/725
<?php
// チェックボックスが複数押された状態だとarrayに格納されるので、
// is_array()で、フィールドがarrayになっているか調べる。
if( is_array(post_custom('フィールド名'))) {
$post_chkbox = post_custom('フィールド名'); // arrayの場合は、そのまま使う
}
else {
$post_chkbox = array(post_custom('フィールド名')); // そうでない場合はarrayに格納しなおす
}
// arrayの内容を表示
foreach($post_chkbox as $val){
echo $val;
}
?>
<?php
// チェックボックスが複数押された状態だとarrayに格納されるので、
// is_array()で、フィールドがarrayになっているか調べる。
if( is_array(post_custom('Favorite Fruits'))) {
$post_chkbox = post_custom('Favorite Fruits'); // arrayの場合は、そのまま使う
}
else {
$post_chkbox = array(post_custom('Favorite Fruits')); // そうでない場合はarrayに格納しなおす
}
// arrayの内容に応じて結果を編集
foreach($post_chkbox as $val){
//
switch($val){
case 'apple':
$return_value = 'Mac';
break;
case 'orange':
$return_value = 'Ubuntu';
break;
case 'banana':
$return_value = 'Windows';
break;
default:
$return_value = 0;
}
echo $return_value;
}
?>
Quick Cache
http://slackline.jp/2010/12/30205243/#i-3
w3c_validator DoCoMo SoftBank WILLCOM mixi-mobile-converter UP.Browser Playstation iPhone Android BlackBerry Nintendo Nitro PDA Windows CE emobile Opera Mini Opera Mobi PalmOS ia_archive Mobile bot slurp
もっと
http://tokkono.cute.coocan.jp/blog/slow/index.php/wordpress/quick-cache-for-mobile-pages/
http://bashalog.c-brains.jp/14/08/06-100100.php
https://hyper-text.org/archives/2014/08/position_absolute_center_layout.shtml
position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; width: 任意の値 height: 任意の値
#img_box2 .navi-image a .testa img{position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
参考
http://yahss.net/wordpress/260-260/
こいつはカテゴリでかつポストタイプは指定無しのコードだった。
一応記録
<?php
$area = $_GET['area'];//urlにpostが渡されていればそれを取得(urlの例 → http://ドメイン/カテゴリスラグ/?area=新宿区)
$catSlg = $category_name;//カテゴリスラグを取得
$cfKey = 'area';//カスタムフィールドのキー名
//続くリストタグで、絞り込み用のリンクを生成。
//これを応用して、チェックボックスなどにして、複数のカスタムフィールドの値による絞り込みも可能。
?>
<ul>
<li><a href="<?php echo get_option('home'); ?>/<?php echo $catSlg ?>"><?php echo ($area == '')? "<strong>すべて</strong>":"すべて" ?></a></li>
<li><a href="<?php echo get_option('home'); ?>/<?php echo $catSlg ?>/?area=新宿区"><?php echo ($area == '新宿区')? "<strong>新宿区</strong>":"新宿区" ?></a></li>
<li><a href="<?php echo get_option('home'); ?>/<?php echo $catSlg ?>/?area=江東区"><?php echo ($area == '江東区')? "<strong>江東区</strong>":"江東区" ?></a></li>
<li><a href="<?php echo get_option('home'); ?>/<?php echo $catSlg ?>/?area=中央区"><?php echo ($area == '中央区')? "<strong>中央区</strong>":"中央区" ?></a></li>
</ul>
<?php
$args = array(
'category_name' => $catSlg,//カテゴリスラグによる絞り込み
'meta_query' => array(//カスタムフィールドによる絞り込み
array(
'key' => $cfKey,//カスタムフィールド名
'value' => $area,//カスタムフィールドの値
"compare" => "LIKE"
)
),
'posts_per_page' => 10,//1ページあたりの表示件数
'paged' => $paged
);
query_posts($args);//実行
?>
要点すぎてちょっと最初よくわからなかったが、
簡単にいうと 絞り込みボタンに?名前=値 をもたして
URLからその値を取得して
それをクエリポストで入れて表示させる。
つまり、タクソノミーページとかなんだけど
クエリポストを書くってこと。
$area = $_GET['area'];//urlにpostが渡されていればそれを取得(urlの例 → http://ドメイン/カテゴリスラグ/?area=新宿区)
ここで値がなかった場合に普通の絞り込んでないやつがでないから
分岐させた。
クエリポストを発動するURLはつまり?名前=値場合のみってコード
忘れずにリセットクエリも分岐でかいとこう
<?php
$shashu = $_GET['shashu'];//urlにpostが渡されていればそれを取得(urlの例 → http://ドメイン/カテゴリスラグ/?area=新宿区)
if($shashu){//入っていればクエリポスト投げる
$cfKey = 'shashu';//カスタムフィールドのキー名
$args = array(
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => get_query_var( 'taxonomy' ),
'field' => 'slug',
'terms' => get_query_var( 'term' ),
),),
'meta_query' => array(//カスタムフィールドによる絞り込み
array(
'key' => 'shashu',//カスタムフィールド名
'value' => $shashu,//$area,//カスタムフィールドの値
/* "compare" => "LIKE"*/
)
),
// 'posts_per_page' => 10,//1ページあたりの表示件数
'paged' => $paged,
'post_type' => 'shop',
);
query_posts($args);
}
?>
いろんなカテゴリでつかえるように動的にした。
'taxonomy' => get_query_var( 'taxonomy' ), 'field' => 'slug', 'terms' => get_query_var( 'term' ), このあたりとか
ポストタイプと
メタキーは直入れだもんで
他のポストタイプのときは使えんで分岐してかきなおしゃあ
絞り込みボタン
サブカテゴリ(対応車種): <a href="<?php echo get_term_link($term,get_query_var( 'taxonomy')); ?>/?shashu=NA"><span class="na_c icon_sb">NA</span></a><a href="<?php echo get_term_link($term,get_query_var( 'taxonomy')); ?>/?shashu=NB"><span class="nb_c icon_sb ">NB</span></a><a href="<?php echo get_term_link($term,get_query_var( 'taxonomy')); ?>/?shashu=NC"><span class="nc_c icon_sb">NC</span ></a> </div>
<?php echo get_term_link($term,get_query_var( 'taxonomy')); ?>
こいつのあとに
<?php //カテゴリー・タグ情報を取得(slug,アーカイブページでターム名取得,タクソノミー名取得)
$term = get_term_by('slug',get_query_var( 'term' ),get_query_var( 'taxonomy' )
);
?>
ってのがあるけど下記がアッタから注意
カスタムタクソノミーのアーカイブページで、そのページのタクソノミーのスラッグ名を取得する
$term
これだけです。
echo $term;
とすると、タクソノミーのスラッグ名が表示されます。
さらに「get_term_by」を使用すると、そのタクソノミーの情報を取得できます。
$the_term = get_term_by("slug", $term, "タクソノミー名");
うかつに、$termに変数を代入してしまわないよう注意しましょう。
ほかにも、
投稿記事ページで記事の情報を取得できる「$post」
カテゴリーアーカイブページでカテゴリーIDを取得できる「$cat」などがあります。
.viewer {
min-height:447px;
}
<div id="main_contents_top_fade">
<!--
class="d_ab_right"
-->
<div class="viewer">
<ul>
<li>
<img src="/img/top1.jpg" width="100%" alt="エクステリア工事<?php include("d_a_word/d_a_5_shop_name.php") ?>|スライド画像1" />
</li>
<li>
<img src="/img/top1.jpg" width="100%" alt="エクステリア工事<?php include("d_a_word/d_a_5_shop_name.php") ?>|スライド画像1" />
</li>
</ul>
</div>
</div>
$(window).load(function(){}
は表示速度がおそくなるからとった方がいいね
<script>
$(function(){
$(window).load(function(){
var setElm = $('.viewer'),
setMaxWidth = 1200,
setSliderWidth = 840,//+
setMinWidth = 10,
fadeSpeed = 1500,
switchDelay = 5000,
sideNavi = 'off', // 'on' or 'off'
sideHide = 'show', // 'hide' or 'show'
naviOpc = 0.5;
var setElm2 = $('#main_contents_top_fade');//+
setElm.each(function(){
var targetObj = $(this),
findUl = targetObj.find('ul'),
findLi = targetObj.find('li'),
findLiFirst = targetObj.find('li:first');
findLi.css({display:'block',opacity:'0',zIndex:'99'});
findLiFirst.css({zIndex:'100'}).stop().animate({opacity:'1'},fadeSpeed);
function timer(){
setTimer = setInterval(function(){
slideNext();
},switchDelay);
}
timer();
function slideNext(){
findUl.find('li:first-child').not(':animated').animate({opacity:'0'},fadeSpeed).next('li').css({zIndex:'100'}).animate({opacity:'1'},fadeSpeed).end().appendTo(findUl).css({zIndex:'99'});
}
function slidePrev(){
findUl.find('li:first-child').not(':animated').css({zIndex:'99'}).animate({opacity:'0'},fadeSpeed).siblings('li:last-child').css({zIndex:'100'}).animate({opacity:'1'},fadeSpeed).prependTo(findUl);
}
targetObj.css({width:setSliderWidth,display:'block'});//スライダー幅
// メイン画像をベースにエリアの幅と高さを設定
var setLiImg = findLi.find('img'),
baseWidth = setLiImg.width(),
baseHeight = setLiImg.height();
// レスポンシブ動作メイン
function imgSize(){
var windowWidth = parseInt($(window).width());
if(windowWidth >= setMaxWidth) {
targetObj.css({width:setMaxWidth,height:baseHeight});
findUl.css({width:baseWidth,height:baseHeight});
findLi.css({width:baseWidth,height:baseHeight});
setElm2.css({width:baseWidth,height:baseHeight});//+
} else if(windowWidth < setMaxWidth) {
if(windowWidth >= setMinWidth) {
targetObj.css({width:'100%'});
findUl.css({width:'100%'});
findLi.css({width:'100%'});
setElm2.css({width:'100%'}); //+
} else if(windowWidth < setMinWidth) {
targetObj.css({width:setMinWidth});
findUl.css({width:setMinWidth});
findLi.css({width:setMinWidth});
setElm2.css({width:setMinWidth}); //+
}
var reHeight = setLiImg.height();
targetObj.css({height:reHeight});
findUl.css({height:reHeight});
findLi.css({height:reHeight});
setElm2.css({height:reHeight}); //+
}
}
$(window).resize(function(){imgSize();}).resize();
// サイドナビボタン(有り無し)
var agent = navigator.userAgent;
if(sideNavi == 'on'){
targetObj.append('<a href="javascript:void(0);" class="btnPrev"></a><a href="javascript:void(0);" class="btnNext"></a>');
var btnPrev = targetObj.find('.btnPrev'),btnNext = targetObj.find('.btnNext'),btnPrevNext = targetObj.find('.btnPrev,.btnNext');
if(agent.search(/iPhone/) != -1 || agent.search(/iPad/) != -1 || agent.search(/iPod/) != -1 || agent.search(/Android/) != -1){
btnPrevNext.css({opacity:naviOpc});
} else {
btnPrevNext.css({opacity:naviOpc}).hover(function(){
$(this).stop().animate({opacity:naviOpc+0.2},200);
},function(){
$(this).stop().animate({opacity:naviOpc},200);
});
}
if(sideHide == 'hide'){
if(agent.search(/iPhone/) != -1 || agent.search(/iPad/) != -1 || agent.search(/iPod/) != -1 || agent.search(/Android/) != -1){
btnPrevNext.css({visibility:'visible'});
} else {
btnPrevNext.css({visibility:'hidden'});
targetObj.hover(function(){
btnPrevNext.css({visibility:'visible'});
},function(){
btnPrevNext.css({visibility:'hidden'});
});
}
}
btnPrev.click(function(){switchPrev();});
btnNext.click(function(){switchNext();});
}
// ボタン移動動作
function switchNext(){
findLi.not(':animated').parents('ul').each(function(){
clearInterval(setTimer);
slideNext();
timer();
});
}
function switchPrev(){
findLi.not(':animated').parents('ul').each(function(){
clearInterval(setTimer);
slidePrev();
timer();
});
}
});
});
});
</script>
http://black-flag.net/jquery/20131217-4909.html
<div class="viewer"> <ul> <li><a href="#1"><img src="img/photo1.jpg" alt=""></a></li> <li><a href="#2"><img src="img/photo2.jpg" alt=""></a></li> <li><a href="#3"><img src="img/photo3.jpg" alt=""></a></li> <li><a href="#4"><img src="img/photo4.jpg" alt=""></a></li> <li><a href="#5"><img src="img/photo5.jpg" alt=""></a></li> <li><a href="#6"><img src="img/photo6.jpg" alt=""></a></li> </ul> </div><!--/.viewer-->
◆CSS
/* .viewer
------------------------- */
.viewer {
margin: 0 auto;
width: 100%;
position: relative;
overflow: hidden;
}
.viewer ul {
width: 100%;
overflow: hidden;
position: relative;
}
.viewer ul li {
top: 0;
left: 0;
width: 100%;
position: absolute;
}
.viewer ul li img {
width: 100%;
}
/* sideNavi
------------------------- */
.viewer .btnPrev,
.viewer .btnNext {
margin-top: -25px;
top: 50%;
width: 50px;
height: 50px;
position: absolute;
z-index: 101;
}
.viewer .btnPrev {
left: 10px;
background: #ccc url(../img/btnPrev.jpg) no-repeat center center;
}
.viewer .btnNext {
right: 10px;
background: #ccc url(../img/btnNext.jpg) no-repeat center center;
}
/* =======================================
ClearFixElements
======================================= */
.viewer ul:after {
content: ".";
height: 0;
clear: both;
display: block;
visibility: hidden;
}
.viewer ul {
display: inline-block;
overflow: hidden;
}
$(window).load(function(){}
は表示速度がおそくなるからとった方がいいね
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(function(){
$(window).load(function(){
var setElm = $('.viewer'),
setMaxWidth = 800,
setMinWidth = 320,
fadeSpeed = 1500,
switchDelay = 5000,
sideNavi = 'off', // 'on' or 'off'
sideHide = 'hide', // 'hide' or 'show'
naviOpc = 0.5;
setElm.each(function(){
var targetObj = $(this),
findUl = targetObj.find('ul'),
findLi = targetObj.find('li'),
findLiFirst = targetObj.find('li:first');
findLi.css({display:'block',opacity:'0',zIndex:'99'});
findLiFirst.css({zIndex:'100'}).stop().animate({opacity:'1'},fadeSpeed);
function timer(){
setTimer = setInterval(function(){
slideNext();
},switchDelay);
}
timer();
function slideNext(){
findUl.find('li:first-child').not(':animated').animate({opacity:'0'},fadeSpeed).next('li').css({zIndex:'100'}).animate({opacity:'1'},fadeSpeed).end().appendTo(findUl).css({zIndex:'99'});
}
function slidePrev(){
findUl.find('li:first-child').not(':animated').css({zIndex:'99'}).animate({opacity:'0'},fadeSpeed).siblings('li:last-child').css({zIndex:'100'}).animate({opacity:'1'},fadeSpeed).prependTo(findUl);
}
targetObj.css({width:setMaxWidth,display:'block'});
// メイン画像をベースにエリアの幅と高さを設定
var setLiImg = findLi.find('img'),
baseWidth = setLiImg.width(),
baseHeight = setLiImg.height();
// レスポンシブ動作メイン
function imgSize(){
var windowWidth = parseInt($(window).width());
if(windowWidth >= setMaxWidth) {
targetObj.css({width:setMaxWidth,height:baseHeight});
findUl.css({width:baseWidth,height:baseHeight});
findLi.css({width:baseWidth,height:baseHeight});
} else if(windowWidth < setMaxWidth) {
if(windowWidth >= setMinWidth) {
targetObj.css({width:'100%'});
findUl.css({width:'100%'});
findLi.css({width:'100%'});
} else if(windowWidth < setMinWidth) {
targetObj.css({width:setMinWidth});
findUl.css({width:setMinWidth});
findLi.css({width:setMinWidth});
}
var reHeight = setLiImg.height();
targetObj.css({height:reHeight});
findUl.css({height:reHeight});
findLi.css({height:reHeight});
}
}
$(window).resize(function(){imgSize();}).resize();
// サイドナビボタン(有り無し)
var agent = navigator.userAgent;
if(sideNavi == 'on'){
targetObj.append('<a href="javascript:void(0);" class="btnPrev"></a><a href="javascript:void(0);" class="btnNext"></a>');
var btnPrev = targetObj.find('.btnPrev'),btnNext = targetObj.find('.btnNext'),btnPrevNext = targetObj.find('.btnPrev,.btnNext');
if(agent.search(/iPhone/) != -1 || agent.search(/iPad/) != -1 || agent.search(/iPod/) != -1 || agent.search(/Android/) != -1){
btnPrevNext.css({opacity:naviOpc});
} else {
btnPrevNext.css({opacity:naviOpc}).hover(function(){
$(this).stop().animate({opacity:naviOpc+0.2},200);
},function(){
$(this).stop().animate({opacity:naviOpc},200);
});
}
if(sideHide == 'hide'){
if(agent.search(/iPhone/) != -1 || agent.search(/iPad/) != -1 || agent.search(/iPod/) != -1 || agent.search(/Android/) != -1){
btnPrevNext.css({visibility:'visible'});
} else {
btnPrevNext.css({visibility:'hidden'});
targetObj.hover(function(){
btnPrevNext.css({visibility:'visible'});
},function(){
btnPrevNext.css({visibility:'hidden'});
});
}
}
btnPrev.click(function(){switchPrev();});
btnNext.click(function(){switchNext();});
}
// ボタン移動動作
function switchNext(){
findLi.not(':animated').parents('ul').each(function(){
clearInterval(setTimer);
slideNext();
timer();
});
}
function switchPrev(){
findLi.not(':animated').parents('ul').each(function(){
clearInterval(setTimer);
slidePrev();
timer();
});
}
});
});
});
</script>
スクリプト開始部分にある設定値の内容は以下の様になっています。
| var setElm = $(‘.viewer’) | スライドショー全体を囲うブロック要素名(IDでも可) |
|---|---|
| setMaxWidth = 800 | スライドショー部分の最大幅 |
| setMinWidth = 320 | スライドショー部分の最小幅 |
| fadeSpeed = 1500 | フェードアニメーションスピード |
| switchDelay = 5000 | スライドアニメーション待機時間 |
| sideNavi = ‘off’ | 左右NEXT/BACKの表示/非表示(表示する場合は「on」) |
| sideHide = ‘hide’ | 左右NEXT/BACKのロールオーバーで表示切り替えON/OFF(常に表示させる場合は「show」等) |
| naviOpc = 0.5 | 左右NEXT/BACKの透過度 |
これらの設定値を変更することでもろもろ調整が可能になっています。
スクリプト全体はあまりシンプルと言える構成ではありませんが
少しの設定値を調整するだけで簡単に設置することは可能になっているかと思います。
画像サイズ(比率)によって各エリアの幅と高さを取得して制御していることもあり
使用する(切り替える)画像は全て幅と高さを同サイズのものを使用する必要があります。
オプション機能としてスライドショーの左右にNEXT/BACKのボタンを表示させるようにもしてあり、
「sideNavi」を「’on’」や「’off’」とすることで表示/非表示を切り替えることができます。
(記述は「off」でなくても「on」じゃなければ何でもいいです・・・)
表示したNEXT/BACKボタンをスライドショーエリアにカーソルが乗った時のみ
表示させるようにするには「sideHide」を「’hide’」とします。
常にボタンを表示させるにはここの値は「’show’」とします。
(記述は「show」でなくても「hide」じゃなければ何でもいいです・・・)
スライドショー自体は1ページ内に複数設置することも可能になっていますが
複数設置した際にNEXT/BACKボタンをつけるとどうも動作がうまくいかなくなるようなので
複数設置する場合はNEXT/BACKボタンは「off」にしてください。
※不完全ですみません。。
新規
<?php
yarpp_related(array(
'post_type' => array('shop', 'mycustompost'),
'show_pass_post' => false, // show password-protected posts
'past_only' => false,
'weight' => array(
'body' => 2,
'title' =>2,
'tax' => array(
'shop_cat' => 2,
))
// 'order' => 'score DESC'//載せる順番
// show only posts which were published before the reference post
// 任意のテンプレートを利用する場合指定
//'template' => 'yarpp-template-xxxxxx.php', // either the name of a file in your active theme or the boolean false to use the builtin template
));
?>
https://wordpress.org/plugins/yet-another-related-posts-plugin/faq/
http://blog.k-kansei.com/?p=728
個数未確認
テンプレートに記載
<?php
yarpp_related(array(
'post_type' => array('sekou', 'mycustompost'),
'show_pass_post' => false, // show password-protected posts
'past_only' => false, // show only posts which were published before the reference post
// 任意のテンプレートを利用する場合指定
//'template' => 'yarpp-template-xxxxxx.php', // either the name of a file in your active theme or the boolean false to use the builtin template
));
?>
https://wordpress.org/plugins/yet-another-related-posts-plugin/faq/
//echo get_the_term_list( $post->ID, ‘sekou_chiiki’, ”, ‘・’, ” );の並び順をオーダー通りに出力
function set_the_terms_in_order ( $terms, $id, $taxonomy ) {
$terms = wp_cache_get( $id, “{$taxonomy}_relationships_sorted” );
if ( false === $terms ) {
$terms = wp_get_object_terms( $id, $taxonomy, array( ‘orderby’ => ‘term_order’ ) );
wp_cache_add($id, $terms, $taxonomy . ‘_relationships_sorted’);
}
return $terms;
}
add_filter( ‘get_the_terms’, ‘set_the_terms_in_order’ , 10, 4 );
function do_the_terms_in_order () {
global $wp_taxonomies;
// the following relates to tags, but you can add more lines like this for any taxonomy
$wp_taxonomies[‘post_tag’]->sort = true;
$wp_taxonomies[‘post_tag’]->args = array( ‘orderby’ => ‘term_order’ );
}
add_action( ‘init’, ‘do_the_terms_in_order’);
追記カスタム
カテゴリなし非表示
'show_option_none' => '',
タイトル部分に親子分岐を追加して重複をコメントアウトした
<h2 class="title1">
<?php
echo $term->name; ?><?php if(is_tax('client') and !is_tax('client','d-marking-design')): echo ' 様'; endif; ?>
制作実績
<?php //後で追加子タームなら親カテ わかりにくくなるためあえてコード重複
//$termにはいってる情報で分岐
if ( $term->parent ) { // 親IDが入ってれば (子だったら)
?>
<span style="font-size:16px; font-weight:normal"> -
<!---TOP部分-->
<?php //親のIDを取得してターム情報を引き出す。
$ido=$term->parent;
$term2=get_term($ido,get_query_var( 'taxonomy' ));
?>
<?php
echo $term2->name;} ?> -
</span>
</h2>
<div style="clear:both"></div>
<div style="margin-top:15px; text-align:center; font-size:15px;"><i class="icon-coffee"></i>ご紹介できる制作物の一部をご紹介いたします。</div>
<?php //カテゴリー・タグ情報を取得(slug,アーカイブページでターム名取得,タクソノミー名取得)
$term = get_term_by('slug',get_query_var( 'term' ),get_query_var( 'taxonomy' )
);
?>
<?php //$termにはいってる情報で分岐
if ( $term->parent ) { // 親IDが入ってれば (子だったら)
?>
<!---TOP部分-->
<?php //親のIDを取得してターム情報を引き出す。上記重複のため
//$ido=$term->parent;
//$term2=get_term($ido,get_query_var( 'taxonomy' ));
?>
<div class="sekou_cate_box" style="margin-top:20px;">
<ul>
<li class="parent">
<a href="<?php //子 親のターム情報からターム名とリンクを引き出す。
echo get_term_link($term2->slug,get_query_var( 'taxonomy' )); ?>
">
<?php
echo $term2->name; ?>
</a>
</li>
<!---一覧部分-->
<?php
wp_list_categories( array(
'title_li' => '',
'taxonomy' => get_query_var( 'taxonomy' ),
'child_of' => $term->parent,//親のIDを出力
'hide_empty' => 0,
'show_option_none' => '',
) );
}
else { //親だったらそのまま出力
?>
<!---TOP部分-->
<div class="sekou_cate_box" style="margin-top:20px;">
<ul>
<li class="parent">
<a href="<?php //親
echo get_term_link($term->slug,get_query_var( 'taxonomy' )); ?>
">
<?php
echo $term->name; ?>
</a>
</li>
<!---一覧部分-->
<?php
wp_list_categories( array(
'title_li' => '',
'taxonomy' => get_query_var( 'taxonomy' ),
'child_of' => $term->term_id,
'hide_empty' => 0,
'show_option_none' => '',
) );
}?>
</ul>
</div>
<div style="margin-top:15px; text-align:center; font-size:15px;"><i class="icon-coffee"></i>ご紹介できる制作物の一部をご紹介いたします。</div>
<?php //カテゴリー・タグ情報を取得(slug,アーカイブページでターム名取得,タクソノミー名取得)
$term = get_term_by('slug',get_query_var( 'term' ),get_query_var( 'taxonomy' )
);
?>
<?php //$termにはいってる情報で分岐
if ( $term->parent ) { // 親IDが入ってれば (子だったら)
?>
<!---TOP部分-->
<?php //親のIDを取得してターム情報を引き出す。
$ido=$term->parent;
$term2=get_term($ido,get_query_var( 'taxonomy' ));
?>
<div class="sekou_cate_box">
<ul>
<li class="parent">
<a href="<?php //子 親のターム情報からターム名とリンクを引き出す。
echo get_term_link($term2->slug,get_query_var( 'taxonomy' )); ?>
">
<?php
echo $term2->name; ?>
</a>
</li>
<!---一覧部分-->
<?php
wp_list_categories( array(
'title_li' => '',
'taxonomy' => get_query_var( 'taxonomy' ),
'child_of' => $term->parent,//親のIDを出力
'hide_empty' => 0,
) );
}
else { //親だったらそのまま出力
?>
<!---TOP部分-->
<div class="sekou_cate_box">
<ul>
<li class="parent">
<a href="<?php //親
echo get_term_link($term->slug,get_query_var( 'taxonomy' )); ?>
">
<?php
echo $term->name; ?>
</a>
</li>
<!---一覧部分-->
<?php
wp_list_categories( array(
'title_li' => '',
'taxonomy' => get_query_var( 'taxonomy' ),
'child_of' => $term->term_id,
'hide_empty' => 0,
) );
}?>
</ul>
</div>
css
/*施工例カテゴリ*/
.sekou_cate_box{ font-size:12px; margin-top:10px;}
.sekou_cate_box ul{
margin: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 10px;
padding-left: 0px;
overflow: hidden;
}
.sekou_cate_box li{
float: left;
list-style-type: none;
padding: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 10px;
margin-left: 0px;
}
.sekou_cate_box li a{
display:block;
border: 1px solid #CCC;
margin-right: 10px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding-top: 5px;
padding-right: 8px;
padding-bottom: 5px;
padding-left: 8px;}
.sekou_cate_box li a:hover{ text-decoration:none;
background-color:#FF6A29;
color:#FFF}
.parent a{ color:#FFF;
background-color:#06338F;}
.sekou_cate_box li.current-cat a{color:#FFF;
background-color:#06338F;}
ファンクション
4.4.2修正版コード
sekou_catの部分はタクソノミー名<div class="sekou_cate_box"> <?php $parents = getRootTaxonomies( get_the_terms( $post->ID,"sekou_cat"), "0" ); foreach($parents as $pv){ echo "<ul>\n"; echo '<li class="parent"><a href="/sekou_cat/'.$pv->slug.'">'.$pv->name.'</a></li>'."\n"; //echo "<li>\n"; foreach($pv->children as $ck=>$cv){ echo '<li><a href="/sekou_cat/'.$cv->slug.'">'.$cv->name.'</a></li>'."\n"; } //echo "</li>\n"; echo "</ul>\n"; } ?> </div>css
/*施工例カテゴリ*/ .sekou_cate_box{ font-size:12px; margin-top:10px;} .sekou_cate_box ul{ margin: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; overflow: hidden; } .sekou_cate_box li{ float: left; list-style-type: none; margin:0px; padding:0px; } .sekou_cate_box li a{ display:block; border: 1px solid #CCC; margin-right: 10px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; padding-top: 5px; padding-right: 8px; padding-bottom: 5px; padding-left: 8px;} .sekou_cate_box li a:hover{ text-decoration:none; background-color:#FF6A29; color:#FFF} .parent a{ color:#FFF; background-color:#06338F;}参考http://tipsbear.com/wordpress-taxonomy-get-terms-listing-in-order-of-parent-child/
<div class="hisu">必須</div>
.hisu{ display:inline-block;
background-color:#f1b32d;
color:#FFF;
font-size:12px;
padding-left:10px;
padding-right:10px;}
[textarea* your-message minlength:10 maxlength:140] [count your-message]
[textarea* your-message minlength:10 maxlength:140] [count your-message down]
http://afirika.net/ewww-image-optimizer
jquery.page-scroller-309.js について
http://coliss.com/articles/build-websites/operation/javascript/296.html
フィクスドしたヘッドスペースがあるため
-50などとした場合
ページ移管する際、ちゃんとしたマージンがとられないようだ。。
そのため
クラス#go1 のマージンをそのぶんとってやらなければならない。
ページ移管して到達したい場所のマージン・パディングを
#をスクロールさせないこーどもあったのでメモ
<a href="#h2-01" class="nopscr">h2-01に移動</a>(除外対象)
全てのデータをDLして
そのままローカルで使用する際は注意!
http://netaone.com/wp/wordpress-plugin-first/
Yoast SEO seoプラグイン
Shortcoder 冒頭 シメ addクイックタグみたいな
TablePress テーブル
Meta Slider スライド
Image Widget サイドバー画像
Easy FancyBox ライトボックス
WP Social Bookmarking Light
Flamingo
WP BASIC Auth
他
WP Admin UI Customize
2020 変更 警告でるから
//分岐改造 初期画面その月から
$today = date("Y/m/d");
$today_m = date("n");
$today_y = date("Y");
if(!empty($_GET['year'])){ //空でなければ
$input_y = $_GET['year'];
if($input_y < 1970){
$dogg = $today_m;
}
elseif($input_y < $today_y){
$dogg = 1;
}
elseif($input_y > $today_y){
$dogg = 1;
}
elseif($input_y == $today_y){
$dogg = 1;
}
}
else{
$dogg = $today_m;
}
for ($i=$dogg;$i<13;$i++) :
//元
//for ($i=1;$i<13;$i++) :
2015.11.02下段追記
//分岐改造 古いカレンダーは表示されない
$today = date("Y/m/d");
$today_m = date("n");
$today_y = date("Y");
$input_y = $_GET['year'];
if($input_y < 1970){
$dogg = $today_m;
}
elseif($input_y < $today_y){
$dogg = 1;
}
elseif($input_y > $today_y){
$dogg = 1;
}
elseif($input_y == $today_y){
$dogg = 1;
}
else{
$dogg = $today_m;
}
for ($i=$dogg;$i<13;$i++) :
//元
//for ($i=1;$i<13;$i++) :
多分初期状態つまりカレンダーを読み込んだ状態はyearが0ないし1970よりすくない
だもんで現在の年を取得して
初期読み込みページなら
今日の月を取得して今月から表示
その他はその年すべだす
って分岐追加
すげ〜!
おまけ
ポジションアブソルトで画面の真ん中
1055行目に
target="_blank" rel="nofollow"
追記でいべんとURLはブランク
http://jp.techcrunch.com/2015/05/20/20150519automattic-buys-woocommerce-the-popular-plugin-for-turning-wordpress-into-a-store/
セキュリティ
BruteProtect
ecサイト
WooCommerce