htaccessで ブラウザのキャッシュの時間を調整する

<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 30 minutes"
ExpiresByType text/html "access plus 10 seconds"
ExpiresByType text/css "access plus 10 seconds"

ExpiresByType image/jpg "access plus 7 days"
ExpiresByType image/jpeg "access plus 7 days"
ExpiresByType image/gif "access plus 7 days"
ExpiresByType image/png "access plus 7 days"

ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
</ifModule>

ブラウザキャッシュを有効にしつつCSSファイルも更新させる方法【サイト軽量化&高速化計画】

welcart Top カテゴリ 記事一覧などで役立つコード リンク先

  <?php
	$dslug = $dterm -> slug;
	//echo $dslug;
	$term_link = get_term_link($dslug,category);
	//print_r($term_link) 
	//----------------------カテゴリタイトル-----------------------------
	//カウントで分岐もできるな
//	$dcount = $dterm -> count;
//	echo $dcount;
	?>
	
		    <div class="tsuzuki_box">
    <a href="<?php echo $term_link; ?>" class="link_all link_bottan" style=" font-size:13px;"><?php echo $dterm -> name; ?> ▶▶</a>
    </div>

ループ内

多次元配列の並び替え

PHPのarray_multisort関数が激便利だったので紹介

 

http://php.net/manual/ja/function.array-multisort.php

 

 

//フォーチ 連多次元想配列	並び替え---------
//ソート用の配列を下準備
$amounts = array();
foreach($dterms2 as $key):
	$amounts[] = $key -> name;
	//$amounts[] = $key['name'];
endforeach;
	
//		echo "
<pre>";
//	print_r($amounts);
//	echo "</pre>

";

//	連多次元想配列	並び替え
array_multisort($amounts, SORT_ASC, SORT_STRING, $dterms2);

//	echo "
<pre>";
//	print_r($dterms2);
//	echo "</pre>

";

https://www.stingmuzik.com/%E5%9C%B0%E5%9F%9F%E3%81%8B%E3%82%89%E6%8E%A2%E3%81%99

このページでは
ダブルで並び替えた

 //親のIDをget_termsへ
$args = array('hide_empty'    => false,
			 'childless' => true);
//子ターム一覧を取得
$dterms=get_terms('artist_chiiki',$args);
	//print_r($dterms)
	
	
//フォーチ 連多次元想配列	並び替え---------
//ソート用の配列を下準備
$amounts = array();
$amounts2 = array();
foreach($dterms as $key):
	$amounts[] = $key -> parent;
		$amounts2[] = $key -> term_order;
	//$amounts[] = $key['name'];
endforeach;
	
//		echo "<pre>";
//	print_r($amounts);
//	echo "</pre>";
	
//	連多次元想配列	並び替え
array_multisort($amounts, SORT_ASC, SORT_NUMERIC,$amounts2, SORT_ASC, SORT_NUMERIC,$dterms);
	
//	echo "<pre>";
//	print_r($dterms);
//	echo "</pre>";

MAMP3 から MAMP4へのアップグレード手順

まず、DB ヴァーチャルホストhttpd-vhosts.conf、httpd-ssl.confをコピー保存 バックアップ

新MAMP をDL インストール カスタム MAMP のみ

新しく、MAMPがインストされ、今までのが、MAMP_日付とされる

新しい、MAMPをまず起動してみる。
きどうできればOK
設定で ポート設定 80 & 3306を使用しよう

劇ハマりしたのはここ
phpのバージョン設定 最新の7.2.1になっておると
ローカルでワードプレスのサイトが起動・表示しない、バグってしまうなど色々な状態

これを7.1.12 に変更したら動いた。

その前の段階の手順
/Applications/MAMP/conf/apache
のhttpd.conf
のhttpd-vhosts.conf
httpd-ssl.confのコメントアウトをやめる
httpd-ssl.conf
httpd-vhosts.conf
を過去のものから持ってくる。 正しいのを!
これも間違えて、パスがとうらないものでやったらMAMPが起動しなかった

またssl.confの暗号鍵なのパス記述通りにファイルがないといけないので
apacheに
server.crt
server.csr
server.key
をコピペ

これはhttpsでアクセスできるようにするの回で、制作したやつ。

TOPぺーじしか表示されない
https://qiita.com/musica_gatto/items/5dc8d8c8a57b261488c2

AllowOverride All         ←”none”を”All”に変更

データベース大きいとアップできないので

>>>
「php5.6.2」のフォルダは、先ほど調べたphpのバージョンに合わせて選ぶ形になります。続いてconfフォルダ内にある「php.ini」を開きます。
そこで、
post_max_size
upload_max_filesize
memory_limit
の項目のサイズを目的のサイズに変更していきます。上記のサイズは「post_max_size < upload_max_filesize < memory_limit」とする必要があります。 設定が完了したら、Apacheを再起動すれば完了です。 >>>

MAMPのphpMyAdminでインポートするファイル上限をアップする方法

新しいワードプレスはこれでいけたっぽいが
バージョンが古い 3.8とかのものだと
php7だと
お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。
と出て、
phpのバージョンを5.632に戻すと
表示された。

しかし、やはり7の方が速度が早いようだ。

データベースのバージョンアップを促すような表示がいくつか出てが
ツール → アップデート mysql database
実際なにもせずに、古いデータベースをそのままでいけた。

デバッグした結果
mysqlが 5.5 から 5.6になったから その問題があるのか?
と思って心配して混乱したが
実際はphpのバージョン httpd.confの問題だッかもしれない

このまま問題なくいければ

念のため 新MAMP と 過去MAMPのDPをわけて SSD960に保存 後 各シンボリックリンクで保存

今後の問題
・pro を導入するか?
デメリット
hosterが使えない また ホストの切り替えがスムーズでない
SSLを簡単にできそうだが 結局 キーチェンアクセスに毎回登録しないと 警告がでる
これはオレオレ認証局が鍵を握っているがよくわからない

メリット
ホスターなし、バーチャルホスト直いじらなくともローカル設定ができる//ただホストの切り替えが悪い//また毎回MAMPを再起動
キーチェンアクセスに毎回登録すれば一応ローカルでも保護された通信となる//ただホストの切り替えが悪いため、切り替わったかわかりずらいので 保護された通信でなくともよいかも
無線ラン内でスマホでもローカルにアクセスできるらしい//これはよいね アップしなくとも確認できるのは

サイトによってphpのバージョンが切り替えれる

いままで通り
httpd-vhosts.conf でサイトの追加をするくらいは 特に問題ない 80 も 443も

・ローカルSSLどうするか
結局1回のみの警告なら受け入れれるが 毎回や作業中にでなければよい
保護された通信となった場合 ローカルか サイトか わかりにくい

毎回自己証明をキーチェンに登録するには面倒
毎回ターミナルで認証を発行するのは面倒

 

 

ホストの切り替えが遅い件
現状でも同じだったようで多分SSLのせいで切り替えが遅くなっている模様

 

さて、MAMPのバージョンアップはできたと言っても良い

新しい MAMP
古い MAMPを両方使おうとするならば

MAMP2とする方の
httpd.confに書いてあるパスを
app/mamp2/と変更しないと

MAMP2の方でも MAMP フォルダの ファイルを使用することになるので注意

DBに関してはどうだ?
これはパスがどおとおているかわからない。
起動したフォルダ内のDBがつかかれるのか
app/mamp/とどこかでぱすがとおっているのか?

ためしにやってみたら、起動しなかったので
やはり/MAMP/とパスが通ってそう。

なので両方使いたいなら 毎回 アプリのファイル名の付け替え

MAMP
MAMP_2

を繰り返すことだね!
そうすればhttpd.confに書いてあるパスを
app/mamp2/と変更しなくてもとい

 

そしてPROを検証してみた。

結局ホストの切り替えが遅いのはsslのせいだと思う。
(未検証)
pro のホストには ::1 みたいなv6 なんとかとかのコードもささってて
よさげ

Macの/etc/hostsに記述したローカル用サブドメインへのアクセスが遅い

PROの設定ファイルは
httpd.conf
/Library/Application Support/appsolute/MAMP PRO/conf
にあった

あと
/Users/doggstar/Library/Application Support/appsolute/MAMP PRO/

にも

 

DBは
/Library/Application Support/appsolute/MAMP PRO
内にあるのが使われる なので、シンボリックリンクでMAMPと共有もできるし
テストでは別にした。コピーしてシンボリックした。

また
/Library/Application Support/appsolute/MAMP PRO/conf
には

このようにファイルが入っているが
これを直接エディタでいじくっても、Proを起動させると、前回の内容にもどってしまう。
これには
/Users/doggstar/Library/Application Support/appsolute/MAMP PRO/

temp のファイルが関わってると思って 試しに消してみて再起動してみたら
エディタで変えたものそのままでなく、どこからともなく現れた
最初のProの初期設定に書き換わっていた。

なのでProは直接ファイルをいじるのではなく、Proのエディタから修正しなければならない。

また大きな問題がひとつ
Proのメリット がサイトによってPHPを変更できる点であるが
そのモードにすると
PHP MY ADMIN で32MBのファイルをインポートしようとすると
30秒以上でタイムアウトし、Internal Server Errorが出てしまう。
しかし、そのくせ、インポートは続いているようで、終わるまで戻る操作ができずに、インポートが終わると戻れて、実際インポートできているようだった。

この30秒のタイムアウトだけなんとかしたいと色々調べると
デバッグすると

module mode だと普通に読み込めることがわかったので
CGI mode の phpが問題だということまでわかったが

どこの設定をいじっても30秒でInternal Server Errorが出てしまう。

max_execution_time

[PHP] PHPスクリプトのタイムアウトを調整する

htaccess

【コピペ用】PHPのアップロード容量を変更する.htaccess、php.iniの記述サンプル

などで色々うやったり
MAMPの構造を色々チェックして
phpini とかTIME 30 とかのところを色々探していじったが
どの設定がきいているのか
どこにファイルをさしこめば上書きできるかわからなかって
諦めた。

 

結果
PROを使いたい気持ちが大きくなったが
結局各PHPのバージョン切り替えは行わないか

大きなファイルの時のみ無料版を起動させ
インポートするとか
この場合はDBはシンボリックで同じファイルにしないかん

また
旧サイトをすべてPROに入れるのがめんどい場合
無料版を生かしておき、
過去のサイトの場合は無料版で起動という手もある

しかし、proをつかっていると
private host ファイルがアクセス権がいじられるのでホスターで書き換えできなくなるため
パーミッションをeveryone 読み書きに変えて起動しなければならない一手間もあり。

 

試しにProで

mode を切り替えると
phpのバージョンが全部一括で変更され、

元に戻しても、治らなかったので、一回もどーを変えてインポートするのは現実的ではない。そもそも古いバージョンの需要性はあまりないが。?

 

あと
CGI版の時 phpmyadimin のアパーチが表示がちょがうのに気づいたが何かのヒントになるか?

 

 

 

welcartで会員ページのテーブル レスポンシブ

//カート

//usccart_navi 
div.usccart_navi ol.ucart {
	list-style: none;
	//overflow: hidden; 
	height: auto;
}
div.usccart_navi li.ucart {
	display: block;
	color: #262626;
	font-size: 14px;
	font-weight: bold;
	padding: 0 .909095em 0 1.81818em;
	background: #dedede;
	float: left;
	text-decoration: none;
	text-align: center;
	line-height: 40px;
}
div.usccart_navi li.ucart:before {
	display: block;
	width: 20px;
	height: 20px;
	margin: 0 -20px -20px auto;
	float: right;
	content: " ";
	-webkit-transform: skew(20deg);
	background: #dedede;
	border-right: 4px solid #fff;
	-moz-transform: skew(20deg);
	-o-transform: skew(20deg);
	transform: skew(20deg);
}
div.usccart_navi li.ucart:after {
	display: block;
	width: 20px;
	height: 20px;
	margin: -20px -20px 0 auto;
	background: #dedede;
	border-right: 4px solid #fff;
	position: relative;
	content: " ";
	-webkit-transform: skew(-20deg);
	-moz-transform: skew(-20deg);
	-o-transform: skew(-20deg);
	transform: skew(-20deg);	
}
div.usccart_navi li.ucart:last-child:before,
div.usccart_navi li.ucart:last-child:after {
	border: none;
}

body div.usccart_navi li.usccart_confirm,
body div.usccart_navi li.usccart_confirm:before,
body div.usccart_navi li.usccart_confirm:after,

body div.usccart_navi li.usccart_customer,
body div.usccart_navi li.usccart_customer:before,
body div.usccart_navi li.usccart_customer:after,

body div.usccart_navi li.usccart_cart,
body div.usccart_navi li.usccart_cart:before,
body div.usccart_navi li.usccart_cart:after,

body div.usccart_navi li.usccart_delivery,
body div.usccart_navi li.usccart_delivery:before,
body div.usccart_navi li.usccart_delivery:after
{

	color: #fff;
	background-color: #161616;
}

div.usccart_navi li.ucart.usccart_confirm, div.usccart_navi li.ucart.usccart_confirm:beforee, div.usccart_navi li.ucart.usccart_confirm:after {
    color: #fff;
	background-color: #161616;}


div.header_explanation{clear: both;}

//確認テーブル

#confirm_table td{font-size: 14px;padding: 12px;}
#confirm_table .ttl{background: @site_color_main}
#confirm_table h3{color: #fff;}


//会員情報
#memberinfo{
.retail{margin-bottom: 24px;}
	
	.order_head_value td{padding: 12px;}
	table .num{font-size: 100%}
	th{font-size: 90%}
	h3{ background: none;
	color: #333;
	font-size: 18px;
	height: auto;
	border: none;
	text-indent: inherit;
		padding-top: 24px; padding-bottom: 12px;
	}
	.customer_form input#zipcode{width: auto; }
	.customer_form input{width: auto; margin-left: 6px; margin-right: 6px;}
	select{font-size: 15px; margin-left: 6px; }
	
	.edit_member,.logout_member{display: none;}
	
	#memberdetail{margin-top: 60px;}
	
	.send input:nth-child(3){display: none}

}

@media screen and (max-width: 736px) {
//ナビ

	div.usccart_navi li.ucart{width:auto;font-size: 11px}
	.back_cart_button,.to_deliveryinfo_button,.back_to_delivery_button{margin-bottom: 12px;}
	
	#customer-info .customer_form input{width: 100%;}
	
	//カート1P目
	#inside-cart{#cart_table{.num,.thumbnail,.stock,.mov_none{display: none;}}}
	
	//カート4P目
	#info-confirm{#cart_table{.num,.thumbnail,.stock,.mov_none,.action{display: none;}}
	
	}
	
	
	#memberinfo{
		  width: 100%;
  table-layout: fixed;
  word-break: break-all;
  word-wrap: break-all;
		
		#memberdetail{ margin-top: auto;
			th,td{display: block} .blank_cell,.blank{display: none}}
		
		#history_head{th,td{display: block; padding: 12px;font-size: 12px;} 
			thead,tbody{ float: left;width: 50%;}
			tr{display: block;}
		
		}
		
		.retail{.cartrownum,.thumbnail{display: none;} margin-bottom: 60px;}
		
		.customer_form input{width: 100%;}
	}
	
	
	}
.customer_form input{width: 100%;}

これでなぜかテーブルがレスポンではみ出ない

welcart で ブログカードを使う方法

WordPressホーム/wp-includes/theme-compat/

embed-content.php
をテーマフィアルに

<?php
/**
 * Contains the post embed content template part
 *
 * When a post is embedded in an iframe, this file is used to create the content template part
 * output if the active theme does not include an embed-content.php template.
 *
 * @package WordPress
 * @subpackage Theme_Compat
 * @since 4.5.0
 */
?>
	<div <?php post_class( 'wp-embed' ); ?>>
		<?php
		$thumbnail_id = 0;

		if ( has_post_thumbnail() ) {
			$thumbnail_id = get_post_thumbnail_id();
		}

		if ( 'attachment' === get_post_type() && wp_attachment_is_image() ) {
			$thumbnail_id = get_the_ID();
		}

		/**
		 * Filters the thumbnail image ID for use in the embed template.
		 *
		 * @since 4.9.0
		 *
		 * @param int $thumbnail_id Attachment ID.
		 */
		$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );

		if ( $thumbnail_id ) {
			$aspect_ratio = 1;
			$measurements = array( 1, 1 );
			$image_size   = 'full'; // Fallback.

			$meta = wp_get_attachment_metadata( $thumbnail_id );
			if ( ! empty( $meta['sizes'] ) ) {
				foreach ( $meta['sizes'] as $size => $data ) {
					if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {
						$aspect_ratio = $data['width'] / $data['height'];
						$measurements = array( $data['width'], $data['height'] );
						$image_size   = $size;
					}
				}
			}

			/**
			 * Filters the thumbnail image size for use in the embed template.
			 *
			 * @since 4.4.0
			 * @since 4.5.0 Added `$thumbnail_id` parameter.
			 *
			 * @param string $image_size   Thumbnail image size.
			 * @param int    $thumbnail_id Attachment ID.
			 */
			$image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );

			$shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';

			/**
			 * Filters the thumbnail shape for use in the embed template.
			 *
			 * Rectangular images are shown above the title while square images
			 * are shown next to the content.
			 *
			 * @since 4.4.0
			 * @since 4.5.0 Added `$thumbnail_id` parameter.
			 *
			 * @param string $shape        Thumbnail image shape. Either 'rectangular' or 'square'.
			 * @param int    $thumbnail_id Attachment ID.
			 */
			$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
		}

		if ( $thumbnail_id && 'rectangular' === $shape ) : ?>
			<div class="wp-embed-featured-image rectangular">
				<a href="<?php the_permalink(); ?>" target="_top">
					<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>
				</a>
			</div>
		<?php endif; ?>

		<p class="wp-embed-heading">
			<a href="<?php the_permalink(); ?>" target="_top">
				<?php the_title(); ?>
			</a>
		</p>

		<?php if ( $thumbnail_id && 'square' === $shape ) : ?>
			<div class="wp-embed-featured-image square">
				<a href="<?php the_permalink(); ?>" target="_top">
					<?php echo wp_get_attachment_image( $thumbnail_id, //$image_size
					thumbnail
													  ); ?>
				</a>
			</div>
		<?php endif; ?>
		
 <?php if ( usces_is_item() ) : //welcartなら?> 	
	 <div class="wp-embed-featured-image square" style="margin-bottom: 0">
	 <a href="<?php the_permalink(); ?>" target="_top">
		 <?php
//商品画像
usces_the_itemImage(0, 300, 300); ?>
     </a>
      </div>
<?php endif; //welcartなら ?>
	
		<div class="wp-embed-excerpt"><?php the_excerpt_embed(); ?></div>

		<?php
		/**
		 * Prints additional content after the embed excerpt.
		 *
		 * @since 4.4.0
		 */
		do_action( 'embed_content' );
		?>

		<div class="wp-embed-footer" style="display: none">
			<?php// the_embed_site_title() ?>
			

			
			

			<div class="wp-embed-meta">
				<?php
				/**
				 * Prints additional meta content in the embed template.
				 *
				 * @since 4.4.0
				 */
				
				//do_action( 'embed_content_meta');
	
	
				?>
				

			</div>
		</div>
	</div>
<?php

		

とりあえずこうしたぞ

https://ywnb.net/p/201608/3097

レビュープレスは 星がでんかったでやめた。。

さらにカスタム

<?php
/**
 * Contains the post embed content template part
 *
 * When a post is embedded in an iframe, this file is used to create the content template part
 * output if the active theme does not include an embed-content.php template.
 *
 * @package WordPress
 * @subpackage Theme_Compat
 * @since 4.5.0
 */
?>
	<div <?php post_class( 'wp-embed' ); ?>>
		<?php
		$thumbnail_id = 0;

		if ( has_post_thumbnail() ) {
			$thumbnail_id = get_post_thumbnail_id();
		}

		if ( 'attachment' === get_post_type() && wp_attachment_is_image() ) {
			$thumbnail_id = get_the_ID();
		}

		/**
		 * Filters the thumbnail image ID for use in the embed template.
		 *
		 * @since 4.9.0
		 *
		 * @param int $thumbnail_id Attachment ID.
		 */
		$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );

		if ( $thumbnail_id ) {
			$aspect_ratio = 1;
			$measurements = array( 1, 1 );
			$image_size   = 'full'; // Fallback.

			$meta = wp_get_attachment_metadata( $thumbnail_id );
			if ( ! empty( $meta['sizes'] ) ) {
				foreach ( $meta['sizes'] as $size => $data ) {
					if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {
						$aspect_ratio = $data['width'] / $data['height'];
						$measurements = array( $data['width'], $data['height'] );
						$image_size   = $size;
					}
				}
			}

			/**
			 * Filters the thumbnail image size for use in the embed template.
			 *
			 * @since 4.4.0
			 * @since 4.5.0 Added `$thumbnail_id` parameter.
			 *
			 * @param string $image_size   Thumbnail image size.
			 * @param int    $thumbnail_id Attachment ID.
			 */
			$image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );

			$shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';

			/**
			 * Filters the thumbnail shape for use in the embed template.
			 *
			 * Rectangular images are shown above the title while square images
			 * are shown next to the content.
			 *
			 * @since 4.4.0
			 * @since 4.5.0 Added `$thumbnail_id` parameter.
			 *
			 * @param string $shape        Thumbnail image shape. Either 'rectangular' or 'square'.
			 * @param int    $thumbnail_id Attachment ID.
			 */
			$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
		}
 if ( usces_is_item() ) : //welcartならなし
	else:
		if ( $thumbnail_id && 'rectangular' === $shape ) : ?>
			<div class="wp-embed-featured-image rectangular">
				<a href="<?php the_permalink(); ?>" target="_top">
					<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>
				</a>
			</div>
		<?php endif; //welcartならなしおわり
		endif;?>

		<p class="wp-embed-heading">
			<a href="<?php the_permalink(); ?>" target="_top">
				<?php the_title(); ?>
			</a>
		</p>

		<?php if ( $thumbnail_id && 'square' === $shape ) : ?>
			<div class="wp-embed-featured-image square">
				<a href="<?php the_permalink(); ?>" target="_top">
					<?php echo wp_get_attachment_image( $thumbnail_id, //$image_size
					thumbnail
													  ); ?>
				</a>
			</div>
		<?php endif; ?>
		
 <?php if ( usces_is_item() ) : //welcartなら?> 	
	 <div class="wp-embed-featured-image square" style="margin-bottom: 0">
	 <a href="<?php the_permalink(); ?>" target="_top">
		 <?php
//商品画像
usces_the_itemImage(0, 300, 300); ?>
     </a>
      </div>
<?php endif; //welcartなら ?>
	
		<div class="wp-embed-excerpt"><?php 
			//the_excerpt();
			//the_excerpt_embed();
			
			    $description_emb = strip_tags($post->post_content);
      $description_emb = str_replace("\n", "", $description_emb);
      $description_emb = str_replace("\r", "", $description_emb);
	$description_emb = str_replace('"', '*', $description_emb);
      $description_emb = mb_substr($description_emb, 0, 120) . "...";
			
			echo $description_emb;
			
			?>
			<div style="text-align: right">
			<!-- クラス効かない class="link_color" -->
			<a style="color: #f15a24;"
			href="<?php the_permalink(); ?>">
			 <?php if ( usces_is_item() ) : //welcartなら?> 
			 この商品を見る▶︎
			 <?php else: ?>
			 全文を表示する▶︎
			 <?php endif; ?>
			 </a></div>
			</div>

		<?php
		/**
		 * Prints additional content after the embed excerpt.
		 *
		 * @since 4.4.0
		 */
		do_action( 'embed_content' );
		?>

		<div class="wp-embed-footer" style="display: none">
			<?php// the_embed_site_title() ?>
			

			
			

			<div class="wp-embed-meta">
				<?php
				/**
				 * Prints additional meta content in the embed template.
				 *
				 * @since 4.4.0
				 */
				
				//do_action( 'embed_content_meta');
	
	
				?>
				

			</div>
		</div>
	</div>
<?php

		

ReviewPress ループで効かない件 とその他改造

400行目くらいから class-shortcode.php

id raty_rich だからループでおかしくなってたので
クラスにかえ、更に、
記事IDを入れたクラスを付け そこに 星を入れる設定にした。

		$query = new WP_Query( $query_args );

		$total_rating = 0;
		if ( $query->have_posts() ) :
			while ( $query->have_posts() ) : $query->the_post();

			$total_rating += intval( get_post_meta( $post->ID ,'wpbr_review_rating',true ) );
			$parent_title = get_the_title( wp_get_post_parent_id( $post->ID ) );
		
		//tuiki 
		$d_id = $post->ID;

		endwhile;
	
		$rich_rating = "<div class='raty_rich raty_rich".$d_id."' style='color:". review_get_option( 'rating_icon_color', 'wpbr_display' ) ."'></div>";

		if ( 'star' === review_get_option( 'review_icon', 'wpbr_display' ) ) {
			$rich_rating .= "<script>
			jQuery('.raty_rich".$d_id."').raty({
				readOnly : true,
				cancel   : false,
				half     : true,
				score    : '".round( $total_rating / $query->post_count , 2 )."',
				starType : 'i',
				starHalf : 'wpbr-star-half',
				starOff  : 'wpbr-star-off',
				starOn   : 'wpbr-star-on',
			});
			</script>";
		} else {
			$rich_rating .= "<script>
			jQuery('.raty_rich').raty({
				readOnly : true,
				cancel   : false,
				half     : true,
				score    : '".round( $total_rating / $query->post_count , 2 )."',
				starType : 'i',
				starHalf : 'wpbr-heart-half',
				starOff  : 'wpbr-heart-off',
				starOn   : 'wpbr-heart-on',
			});
			</script>";
		}

		ob_start();
		
		?>


<!--シングル-->
	
	<?php if(is_single()):?>		
		<div itemscope itemtype="http://schema.org/Product" class="d_rate">
			<span itemprop="name" style="display:none"><?php echo esc_html( $parent_title ); ?></span>
			<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" >
				<div class="d_rate2">5つ星のうち<span itemprop="ratingValue"><?php echo esc_html( round( $total_rating / $query->post_count , 2 ) ); ?></span> </div>
<!--				based on-->
				<div class="link_color d_rate3" style="cursor: pointer"> <span itemprop="reviewCount"><?php echo esc_html( $query->post_count ); ?></span>件のレビュー</div>
				<div style="display:none">
					<span itemprop="bestRating">5</span>
					<span itemprop="worstRating">1</span>
				</div>
			</div>
		</div>
		
	<?php else:?>		
<!--ループ-->
				<div itemscope itemtype="http://schema.org/Product" class="d_rate" style="margin-left: -12px;">
			<span itemprop="name" style="display:none"><?php echo esc_html( $parent_title ); ?></span>
			<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" >
				<div class="d_rate2">5つ星のうち<span itemprop="ratingValue"><?php echo esc_html( round( $total_rating / $query->post_count , 2 ) ); ?></span> </div>
<!--				based on-->
				<div class=" d_rate3">(<span itemprop="reviewCount"><?php echo esc_html( $query->post_count ); ?></span>件)</div>
				<div style="display:none">
					<span itemprop="bestRating">5</span>
					<span itemprop="worstRating">1</span>
				</div>
			</div>
		</div>
		
		<?php endif;?>

		<?php
		$rich_rating .= ob_get_clean();

		return $rich_rating;

	endif;
	wp_reset_postdata();

ベストセラー スティング

//welcartベストセラー サムネイル+順位表示が画像
add_filter('usces_filter_bestseller', 'my_bestseller_func', 10, 3);
function my_bestseller_func() {
    $args = func_get_args();
    list($html, $post_id, $index) = $args;
    $post = get_post($post_id);
    if ( $index == 0 ){
    $img = '/wp-content/themes/D/d/img/rank/1.png';
}    elseif ( $index == 1 ){
    $img = '/wp-content/themes/D/d/img/rank/2.png';
}    elseif ($index == 2){
    $img = '/wp-content/themes/D/d/img/rank/3.png';
}    else {
}
 $index = $index + 1;
	//usces_have_skus();
	global $usces;//計算始め
	$price = usces_the_firstPrice( 'return',$post );//売価
	$tax = $usces->getTax( $price );//売価×基本設定の税額(税計算方法も考慮します)
	$dprice = number_format($price + $tax);	
	$did = $post_id;
	$did2 = '[REVIEWPRESS_RICH_SNIPPET id="'.$did.'"]';
	$did3 = do_shortcode($did2);
	
    $list = '<a href="' . get_permalink($post_id) . '" class="top_new_item_box"><img src="' . $img . '" width="24" style="padding-bottom:6px; padding-right:6px;" /><span class="rank_num">'.$index.'.</span><div class="top_new_item_sam">
' . usces_the_itemImage(0, 300, 300, $post, 'return' ) . '</div><div class="top_item_name">' . $post->post_title . '</div>
      <div class="top_item_disp">¥'.$dprice.'</span><em class="tax">(税込)</em>
	  
	  		  <div>
	'.$did3.'
</div>
		 
</div>




</a>
';
	
    return $list;
}

youtube 自動でdivで囲う ファンクション

WordPressの投稿にURLだけでYouTube動画を埋め込む際のHTMLをカスタマイズする方法

// Customize YouTube oEmbed Code
function custom_youtube_oembed($code){
  if(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false){
    $html = preg_replace('/ width="\d+"/', '', $html);
    $html = preg_replace('/ height="\d+"/', '', $html);
    $html = '<div class="youtube">' . $html . '</div>';

    return $html;
  }
  return $code;
}

add_filter('embed_handler_html', 'custom_youtube_oembed');
add_filter('embed_oembed_html', 'custom_youtube_oembed');

実際は分岐した
admin-siteファンク

// Customize YouTube oEmbed Code youtube 自動でdivで囲う
function custom_youtube_oembed($code){
  if(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false && is_singular('post')){
    $html = preg_replace("@src=(['\"])?([^'\">\s]*)@", "src=$1$2", $code);
    $html = preg_replace('/ width="\d+"/', '', $html);
    $html = preg_replace('/ height="\d+"/', '', $html);
    $html = '<div class="youtube">' . $html . '</div>';

    return $html;
  }
  return $code;
}

add_filter('embed_handler_html', 'custom_youtube_oembed');
add_filter('embed_oembed_html', 'custom_youtube_oembed');

カテゴリ ターム 一括登録は

WP Taxonomy Import が河島で成功したやつ

Simple Taxonomyが ツールに入ってるやつ

 

WP Taxonomy Import 設定から

愛知県
愛知県->春日井市
愛知県->尾張旭市
愛知県->瀬戸市
愛知県->一宮市
愛知県->小牧市
愛知県->愛西市
愛知県->あま市
愛知県->稲沢市
愛知県->犬山市
愛知県->岩倉市
愛知県->大府市
愛知県->北名古屋市
愛知県->清須市
愛知県->江南市
愛知県->知多市
愛知県->津島市
愛知県->東海市
愛知県->常滑市
愛知県->豊明市
愛知県->長久手市
愛知県->日進市
愛知県->半田市
愛知県->弥富市

愛知県->名古屋市
愛知県->名古屋市->名古屋市名東区
愛知県->名古屋市->名古屋市守山区
愛知県->名古屋市->名古屋市東区
愛知県->名古屋市->名古屋市北区
愛知県->名古屋市->名古屋市千種区
愛知県->名古屋市->名古屋市西区
愛知県->名古屋市->名古屋市中村区
愛知県->名古屋市->名古屋市中区
愛知県->名古屋市->名古屋市昭和区
愛知県->名古屋市->名古屋市瑞穂区
愛知県->名古屋市->名古屋市熱田区
愛知県->名古屋市->名古屋市中川区
愛知県->名古屋市->名古屋市南区
愛知県->名古屋市->名古屋市港区
愛知県->名古屋市->名古屋市緑区
愛知県->名古屋市->名古屋市天白区

愛知県->愛知郡東郷町

愛知県->海部郡大治町
愛知県->海部郡蟹江町
愛知県->海部郡飛鳥村

愛知県->西春日井郡豊山町

愛知県->丹羽郡大口町
愛知県->丹羽郡扶桑町

愛知県->知多郡阿久比町
愛知県->知多郡武豊町
愛知県->知多郡東浦町
愛知県->知多郡南知多町
愛知県->知多郡美浜町


愛知県->岡崎市
愛知県->豊田市
愛知県->安城市
愛知県->刈谷市
愛知県->高浜市
愛知県->知立市
愛知県->西尾市
愛知県->碧南市
愛知県->みよし市
愛知県->額田郡幸田町

愛知県->豊橋市
愛知県->豊川市
愛知県->蒲郡市
愛知県->田原市
愛知県->新城市

愛知県->北設楽郡設楽町
愛知県->北設楽郡東栄町
愛知県->北設楽郡豊根村

岐阜県
岐阜県->多治見市

WP Taxonomy Import 設定から

北海道・東北

北海道・東北->北海道
北海道・東北->青森
北海道・東北->秋田
北海道・東北->岩手
北海道・東北->宮城
北海道・東北->山形
北海道・東北->福島

関東

関東->東京
関東->埼玉
関東->千葉
関東->神奈川
関東->群馬
関東->栃木
関東->茨城


中部
中部->長野
中部->新潟
中部->山梨
中部->愛知
中部->岐阜
中部->三重
中部->静岡


近畿
近畿->京都
近畿->大阪
近畿->兵庫
近畿->奈良
近畿->滋賀
近畿->和歌山


中国・四国
中国・四国->広島
中国・四国->岡山
中国・四国->島根
中国・四国->鳥取
中国・四国->山口
中国・四国->徳島
中国・四国->香川
中国・四国->愛媛
中国・四国->高知



九州・沖縄
九州・沖縄->福岡
九州・沖縄->佐賀
九州・沖縄->長崎
九州・沖縄->大分
九州・沖縄->熊本
九州・沖縄->宮崎
九州・沖縄->鹿児島
九州・沖縄->沖縄

welcart レビュー何件 スクロール表示

スクロール

ページ内を自在にスクロール | よく使うjQuery

$(function() {
 
    //ページ内スクロール
    $(".d_rate3").click(function () {
        var i = $(".btn_sample").index(this)
        var p = $("#go-review").eq(i).offset().top;
        $('html,body').animate({ scrollTop: p }, 'fast');
        return false;
    });
 
    //ページ上部へ戻る
//    $(".btn_top").click(function () {
//        $('html,body').animate({ scrollTop: 0 }, 'fast');
//        return false;
//    });
// 
//
});






<div class=&quot;blog_con&quot;>

<?php the_content(); ?>
	





<div id=&quot;go-review&quot;></div>






	
</div>






レビュープレス

WordPressで口コミ情報(ユーザーレビュー)を募集、掲載できるプラグイン「ReviewPress」

「include」を開き、さらに「class-shortcode.php」を開いて編集
448ぎょうめあたり

		
<!--シングル-->
	
	<?php if(is_single()):?>		
		





<div itemscope itemtype=&quot;http://schema.org/Product&quot; class=&quot;d_rate&quot;>

			<span itemprop=&quot;name&quot; style=&quot;display:none&quot;><?php echo esc_html( $parent_title ); ?></span>
			





<div itemprop=&quot;aggregateRating&quot; itemscope itemtype=&quot;http://schema.org/AggregateRating&quot; >

				





<div class=&quot;d_rate2&quot;>5つ星のうち<span itemprop=&quot;ratingValue&quot;><?php echo esc_html( round( $total_rating / $query->post_count , 2 ) ); ?></span> </div>






<!-- based on-->
				





<div class=&quot;link_color d_rate3&quot; style=&quot;cursor: pointer&quot;> <span itemprop=&quot;reviewCount&quot;><?php echo esc_html( $query->post_count ); ?></span>件のレビュー</div>






				





<div style=&quot;display:none&quot;>
					<span itemprop=&quot;bestRating&quot;>5</span>
					<span itemprop=&quot;worstRating&quot;>1</span>
				</div>






			</div>






		</div>






		
	<?php else:?>		
<!--ループ-->
				





<div itemscope itemtype=&quot;http://schema.org/Product&quot; class=&quot;d_rate&quot; style=&quot;margin-left: -12px;&quot;>

			<span itemprop=&quot;name&quot; style=&quot;display:none&quot;><?php echo esc_html( $parent_title ); ?></span>
			





<div itemprop=&quot;aggregateRating&quot; itemscope itemtype=&quot;http://schema.org/AggregateRating&quot; >

				





<div class=&quot;d_rate2&quot;>5つ星のうち<span itemprop=&quot;ratingValue&quot;><?php echo esc_html( round( $total_rating / $query->post_count , 2 ) ); ?></span> </div>






<!-- based on-->
				





<div class=&quot; d_rate3&quot;>(<span itemprop=&quot;reviewCount&quot;><?php echo esc_html( $query->post_count ); ?></span>件)</div>






				





<div style=&quot;display:none&quot;>
					<span itemprop=&quot;bestRating&quot;>5</span>
					<span itemprop=&quot;worstRating&quot;>1</span>
				</div>






			</div>






		</div>






		
		<?php endif;?>

シングル星平均

<?php $did = get_the_ID(); echo do_shortcode( ' [REVIEWPRESS_RICH_SNIPPET id=&quot;'.$did.'&quot;] ' ); ?>
  <?php wp_reset_postdata();?>

レビューと 登録フォーム

2つ並べるとコメント記事のIDが入りおかしくなるから

wp_reset_postdata();

<?php $did = get_the_ID(); // echo $did; echo do_shortcode( ' [REVIEWPRESS_SHOW id=&quot;'.$did.'&quot;] ' ); ?>




<?php// comment_form(); ?>
<?php// comments_template('', false); ?>



<?php echo do_shortcode( ' [REVIEWPRESS_FORM] ' ); ?>

ループ

		  





<div>
		  <?php $did = get_the_ID(); echo do_shortcode( ' [REVIEWPRESS_RICH_SNIPPET id=&quot;'.$did.'&quot;] ' ); ?>
</div>






// ]]>

WELCART カート確認画面で 獲得ポイント表示

参考

print_r( $usces_entries['order'] );
//結果
Array
(
    [usedpoint] => 
    [total_items_price] => 1000
    [discount] => 0
    [shipping_charge] => 0
    [cod_fee] => 0
    [payment_name] => 代引き
    [delivery_method] => 0
    [delivery_date] => 指定できません
    [delivery_time] => 指定できません
    [total_full_price] => 1000
    [note] => 
    [tax] => 0
    [delidue_date] => 
    [cus_id] => 
    [total_price] => 1000
    [getpoint] => 100
)
<table cellspacing="0" id="point_table">
    <tr>
        <td class="c-point">付与されるポイント</td>
        <td><span class="point"><?php echo $usces_entries['order']['getpoint']; ?></span>pt</td>
    </tr>
</table>

これを直接confirm.phpに記載

142 </table>の下 ポイントを利用するの下

	<table cellspacing="0" id="point_table">
    <tr>
        <td class="c-point">今回獲得ポイント</td>
        <td><span class="point" style="color:red"> '. $usces_entries['order']['getpoint'] .'</span> pt</td>
    </tr>
</table>

welcart カートページでの税込み表示

www.welcart.com/documents/manual/cart
カートの構成
cart.php/カート
商品詳細画面から「カートへ入れる」のボタンが押されたときに最初に表示されるページです。
購入しようとしている商品の一覧が表示されます。
カートで購入する数量を変更することができます。
customer_info.php/お客様情報入力画面
メールアドレスなどのお客様情報を記入してもらう画面が表示されます。
サブナビに表示される「清算する」項目をクリックしてもこのページに移動します。
delivery_info.php/発送・支払い方法入力画面
発送先・支払方法を選択する画面が表示されます。
発送先をお客様情報で記入した場所と同じところに送るか、別の場所に送るかを選択することができます。
confirm.php/内容確認画面
今まで入力してきた購入商品・お客様情報・発送先・支払方法を最終的に確認します。
completion.php/買い物完了画面
内容確認画面で「上記内容で注文する」ボタンを押した後に表示される画面です。
error.php/エラー画面
カート内でなんらかのエラーが生じた場合に表示される画面です。

cart.php/カート

$cart_table_footer = '</tbody>

		
<tfoot>
		
<tr>
			
<th class="num">&nbsp;</th>

			
<th class="thumbnail">&nbsp;</th>

			
<th colspan="3" scope="row" class="aright">' . __('total items','usces') . usces_guid_tax('return') . '</th>

			
<th class="aright">' . usces_crform($this->get_total_price(), true, false, 'return') . '</th>

			
<th class="stock">&nbsp;</th>

			
<th class="action">&nbsp;</th>

		</tr>

';
	
	//税込み 追記	
	 $total_price = usces_total_price('return') - usces_order_discount('return');
    $tax = $this -> getTax( $total_price );
	
	$cart_table_footer .='
	
<tr>
        
<td colspan="5" class="aright">'.usces_tax_label(array(), 'return').'</td>

        
<td class="aright">'. usces_crform($tax, true, false,'return').'</td>

        
<td colspan="2">&nbsp;</td>

    </tr>

    
<tr>
        
<th colspan="5" class="aright">税込合計<em class="tax">(税込)</em></th>

        
<th class="aright">'.
		usces_crform(($total_price + $tax), true, false, 'return'). '</th>

        
<th colspan="2">&nbsp;</th>

    </tr>

';

		
	//ここまで 	
	$cart_table_footer .='	</tfoot>

	</table>

';

これを追加 へんこう

参考
welcustom.net/consumption-tax-cart-page/

<?php if ( 'exclude' == $this->options['tax_mode'] ): ?>
<?php $total_price = usces_total_price('return') - usces_order_discount('return'); $tax = $this -> getTax( $total_price );
?>
    
<tr>
        
<td colspan="5" class="aright"><?php _e('consumption tax', 'usces'); ?></td>

        
<td class="aright"><?php echo usces_crform($tax, true, false); ?></td>

        
<td colspan="2">&nbsp;</td>

    </tr>

    
<tr>
        
<th colspan="5" class="aright"><?php _e('total items','usces'); ?><em class="tax">(税込)</em></th>

        
<th class="aright"><?php echo usces_crform(($total_price + $tax), true, false); ?></th>

        
<th colspan="2">&nbsp;</th>

    </tr>

<?php endif; ?>

カテゴリーの子か孫かアーカイブで判断するコードcat_is_ancestor_of

is_categoryとin_categoryの違いや使い方、条件分岐、複数指定、子孫カテゴリがある場合などなど

<?php if (is_category(5) || cat_is_ancestor_of(5, $cat)) { ?>
skyまたはskyの子孫となるカテゴリ一覧ページで表示される部分
<?php } ?>

ただ プリゲットポストpre_get_posts
で使えない

海外のサイトで発見

https://wordpress.stackexchange.com/questions/46008/how-to-check-if-a-child-category-is-being-queried

function change_number_of_posts($query) {
    if ($query->is_category){
         $cat = get_queried_object();
         $cat_id = (int) $cat->term_id;

         if( $query->is_category('recipes') || $query->is_category('product-reviews')){
              $query->query_vars['posts_per_page'] = -1; 
         }elseif(cat_is_ancestor_of(6,$cat_id)){
              $query->query_vars['posts_per_page'] = -1; 
         }
    }

    return $query;
}

add_filter('pre_get_posts', 'change_number_of_posts'); 

だもんでwelcart用にこうなった

		//welcart用
 if ($query->is_category){
	 $cat = get_queried_object();
         $cat_id = (int) $cat->term_id;
	if (is_category(287) ||
		cat_is_ancestor_of(287, $cat_id) && $query->is_main_query() ) {
$query->set('posts_per_page', 12 );
$query->set('meta_key','release');		
$query->set('orderby', array('meta_value' => 'DESC', 'date' => 'DESC') );//ブログはmeta_key release を使わないから'date' => 'DESC'が適用
  }
 }
	

フォントアイコンをCSS コンテンツで出す方法

「Fontello」を使えばアイコンフォントが簡単に使える!アイコン選んでソースコピペするだけ!

アイコンフォントの具体的な使い方 – Fontello


https://www.plusdesign.co.jp/blog/?p=3158

li.”クラス名”:before {
font-family: 'fontello';
content: '表示するアイコンのUnicode';
}

表示するアイコンのUnicode
「demo.html」のページで、[show codes]
fontello-codes.css」を見る

0xe852

0x
は本来バックスラッシュでいれるようだ
マックでバックスラッシュは
\
オプション¥で入れれる

結果
.tagcloud a:before {

font-family:'fontello';
content: '\e856';
 padding-right: 4px;
}

ブロガー 移行

//コンテンツ内のブロガー画像へのリンクをとる正規表現
add_filter( 'the_content', 'attachment_image_link_remove_filter' );
    function attachment_image_link_remove_filter( $content ) { 
        $content = 
        preg_replace(
        array('{<a(.*?)(blogspot)[^>]*><img}', 
        '{ *" /></a>}'), 
        array('<img','" />'), 
        $content
    );
    return $content; 
}

https://qiita.com/katsukii/items/1c1550f064b4686c04d4
https://msdn.microsoft.com/ja-jp/library/cc392020.aspx
https://qiita.com/honeydaisuki/items/d2a38cef1b95fd347fa4

https://qiita.com/potetopote_/items/6bb809db8f93803991cc

カスタムフィールドサーチ car.cssの書き出し

/*----------------------カスタムフィールドサーチ------------------*/

.car_serch_page_under{
	padding: 10px;
	border: 1px solid #CCC;
	background-color: #f7f8f8;
}

.car_serch_title_under{
	background-color: #9fa0a0;
	padding: 5px;
}

/*.searchform-paramsをboxに変更*/

.searchform-box{
	overflow: hidden;
	padding:20px;
}

.searchform-param{
	overflow: hidden;
}


/*インプット項目
左寄せ*/
.searchform-input-wrapper{ text-align:left}

.searchform-input-wrapper{
	/* width: 100%;	width: auto;*/
	}


/*チックボックス*/
input[type='checkbox']{

}
.checkbox-wrapper{
	float: left;
	margin-right: 10px;
	
}




/*項目見出し*/
.searchform-label{
	/*float: none;*//*ラベルのフロート解除*/
	/*width:100%; *//*ラベルの幅*/
	font-size: 14px;
	font-weight:normal;


}
/*サブミット全体*/
.searchform-controls{
	text-align: center;
	margin-top: 30px;
	margin-bottom:20px;
}


.searchform-controls 
input[type='submit']{
	font-size: 24px;
	padding-right: 20px;
	padding-left: 20px;
	background-image: url(/wp-content/themes/D/d/img/car/serch.png);
	background-repeat: no-repeat;
	text-indent: -9999px;
	background-color: #999;
	width: 167px;
	background-position: center center;
	display: inline-block;
	height: 46px;
	}

/*テキストインプット*/

.searchform-input-wrapper input{
	font-size: 14px;
	
/*	width: 90%;*/
}



/*検索項目の各マージン*/
.DropDownField,.TextField,.CheckboxInput{
	margin-top: 20px;
	/*clear: left;
	float: left;*/
/*	width: 100%;*/
	font-size: 14px;	
}

/*----------------------nth-childで上から順に指定-----------------------*/


/*上限 下限 選択のため*/
.car_search2,.car_search3,.car_search4,.car_search5,.car_search6,.car_search7,.car_search10,.car_search11,.car_search12
{ float:left;}




.car_search8
{ padding-top:20px;
	clear:both;
}




/*ドロップダウン部分サイズ*/
.searchform-input-wrapper{ 

/*width:30%*/

}

.car_search2 .searchform-input-wrapper,.car_search3 .searchform-input-wrapper,
.car_search4 .searchform-input-wrapper,.car_search5 .searchform-input-wrapper,
.car_search6 .searchform-input-wrapper,.car_search7 .searchform-input-wrapper,
.car_search10 .searchform-input-wrapper,.car_search11 .searchform-input-wrapper,
.car_search12 .searchform-input-wrapper

{ width:100px;}

.car_search8 .searchform-input-wrapper,.car_search9 .searchform-input-wrapper{ width:234px;}

/*ラベルサイズ固定*/
.searchform-label{ width:223px;}

.car_search3 .searchform-label,.car_search5 .searchform-label,.car_search7 .searchform-label,
.car_search11 .searchform-label,.car_search12 .searchform-label
{ width:24px; margin-left:10px;}

/*詳細前あける*/

.car_search9{ margin-bottom:20px;}



/*サイドバーの検索 & cssリセット*/

.car_serch_page_side .searchform-box{ padding:10px;}

.car_serch_page_side .car_search{float:none; margin-top:14px;}
.car_serch_page_side .searchform-label{ width:100%; margin-left:0px;}

.car_serch_page_side .searchform-input-wrapper{ width:96%;}

.car_serch_page_side .car_search4 .searchform-input-wrapper,
.car_serch_page_side .car_search5 .searchform-input-wrapper
{ width:44%;}

.car_serch_page_side  .car_search5  .searchform-label{ width:0px; margin-left:0px;}

.car_serch_page_side  .searchform-controls{ text-align:left; margin-left:10px;}

.car_serch_page_side .searchform-controls 
input[type='submit']{
	font-size: 24px;
	padding-right: 20px;
	padding-left: 15px;
	background-image: url(/wp-content/themes/D/d/img/car/submit.png);
	background-repeat: no-repeat;
	text-indent: -9999px;
	background-color: #999;
	width: 100px;
	background-position: center center;
	display: inline-block;
	height: 46px;
	}
	
	
	.car_serch_page_side .searchform-controls{ margin-top:20px;}
	.car_side_menu select#cat{ width:100%; font-size:14px;}

中古 ファンクションからきりだし

//未使用目もこーど//タクソノミ選択とカスタムフィールドのラジオボタンをシンクロさせる
//http://yahss.net/wordpress/1302-synchronize-tax-with-customfield/
function my_print_footer_scripts() {
    global $post_type;
    if ($post_type == 'estate'): ?>
<script type="text/javascript">
    //<![CDATA[
    jQuery(function($){
 
        // タクソノミ選択チェックボックスをラジオボタンに
        $(".categorychecklist input[type=checkbox]").each(function(){
            $(this).attr("type","radio");
        });
 
        // タクソノミIDとタクソノミ名を配列に定義
        var tax_arr = new Array();
        tax_arr['#in-tax_estate-6'] = '売買物件';
        tax_arr['#in-tax_estate-7'] = '賃貸物件';
 
        // タクソノミクリック時の処理
        $("input[name^=tax_input]").live("click", function(){
            $("input[name^=tax_input]").each(function(){
                if ( $(this).is(':checked') == true ) {
                    taxid = $(this).val();
                    taxname = tax_arr['#in-tax_estate-'+taxid];
                    return false;
                }
            });
            $("#acf-field-sellrent-"+taxname).attr('checked', 'checked');
        });
 
        // カスタムフィールドのラジオボタンクリック時の処理
        $("[id^=acf-field-sellrent-]").live("click", function(){
            $("[id^=acf-field-sellrent-]").each(function(){
                if ( $(this).is(':checked') == true ) {
                    taxname = $(this).val();
                    return false;
                }
            });
            for (var key in tax_arr) {
                if ( tax_arr[key] == taxname ) taxid = key;
            }
            $(taxid).attr('checked', 'checked');
        });
 
    });
    //]]>
</script>
<?php
    endif;
}
add_action('admin_print_footer_scripts', 'my_print_footer_scripts', 21);

商品 車販売 ブログ と検索と結果のページを分ける方法

検索フォームと検索結果ページを複数設置する

ここ参考

まず車はポストタイプカー

<div class="search_box">
<form role="search" method="get" id="searchform" action="/" >
<input type="text" value="<?php the_search_query(); ?>" name="s" class="s" />
<input type="hidden" name="post_type" value="car">
<input type="submit" class="searchsubmit" value="" />
</form>
</div>
<?php //if(function_exists('wp_custom_fields_search')) wp_custom_fields_search(); ?>
</div>

welcartは商品カテゴリ内 ポストタイプポスト

       <div class="search_box">
<form role="search" method="get" id="searchform" action="/" >
<input type="text" value="<?php the_search_query(); ?>" name="s" class="s" />
<input type="hidden" name="post_type" value="post">
 <input type="hidden" name="cat" id="cat" value="287" />
<input type="submit" class="searchsubmit" value="" />
</form>
</div>
<?php //if(function_exists('wp_custom_fields_search')) wp_custom_fields_search(); ?>
</div>

//ブログは商品カテゴリ除外

 <div class="search_box">
<form role="search" method="get" id="searchform" action="/" >
<input type="text" value="<?php the_search_query(); ?>" name="s" class="s" />
<input type="hidden" name="post_type" value="post">
 <input type="hidden" name="cat" id="cat" value="-287" />
<input type="submit" class="searchsubmit" value="" />
</form>
</div>
<?php //if(function_exists('wp_custom_fields_search')) wp_custom_fields_search(); ?>
</div>

検索結果は
ポストタイプごとに分けれるらしい
earch-投稿タイプ名.php” というテンプレートが使えるようになります。

add_filter('template_include','custom_search_template');
function custom_search_template($template){
  if ( is_search() ){
    $post_types = get_query_var('post_type');
    foreach ( (array) $post_types as $post_type )
      $templates[] = "search-{$post_type}.php";
    $templates[] = 'search.php';
    $template = get_query_template('search',$templates);
  }
  return $template;
}

ブログ結果添付内で
商品ならで違うフォームにとばしてリターンさせてブログはわけれそう

但し、車のファンクションで
is serch でメインクエリかけてる部分があるので
それを入れてるとブログの検索結果が除外されてしまうので
そこは検証

// サーチ ページ数
    if ( $query->is_search() && $query->is_main_query() ) {
$query->set('posts_per_page', 12 );
 $query->set( 'meta_key', 'car_open' );
 $query->set( 'orderby', 'meta_value_num' );
 $query->set( 'order', 'ASC' ); //数値が低い順
  }

これが問題なようだ

// サーチ ページ数
    if ( $query->is_search() && $query->is_main_query() ) {
$sortset = (string)filter_input(INPUT_POST, 'post');
	if ($sortset == 'car' ){
$query->set('posts_per_page', 12 );
 $query->set( 'meta_key', 'car_open' );
 $query->set( 'orderby', 'meta_value_num' );
 $query->set( 'order', 'ASC' ); //数値が低い順
  }
		}

としてpostがカーのときのみこれが効く様にした。

どうやらINPUT_POSTでなく INPUT_GETなようだ