http://uguisu.skr.jp/tax/kousei.html
ノウゼイチの変更とともにhttps://www.nta.go.jp/tetsuzuki/shinsei/annai/shinkoku/annai/05.htm
出す
まず
AddQuicktagにて基本的な区切り等を挿入
そのためにスタイルを指定するため
エディタースタイルの他に
ツアー個ページのcssを読み込ます。
ファンクションに
1 2 3 4 5 6 7 8 9 10 | add_editor_style( '../../../css/tama2.css' ); さらにはTinyMCE Advancedでスタイルを使用する為に エディタースタイルcssをeditor-style1.cssと逃げさせて editor-style.cssを空にしてそこにスタイルを追加していく ここはクライアントにわかりやすくするために スタイル名は研ぎすます事 add_editor_style( 'd_con/editor-style.css' ); add_editor_style( 'd_con/editor-style1.css' ); |
TinyMCE Advancedの
Load the CSS classes used in editor-style.css and replace the Formats button and sub-menu.
にチェックで
editor-style.cssが読み込まれる模様
あと設定エクスポートできるらしい
クイックたぐも
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | .rainbow { background : -moz- linear-gradient ( left , rgba ( 255 , 0 , 0 , 0.2 ), rgba ( 255 , 69 , 0 , 0.2 ), rgba ( 255 , 255 , 0 , 0.2 ), rgba ( 0 , 128 , 0 , 0.2 ), rgba ( 0 , 0 , 255 , 0.2 ), rgba ( 75 , 0 , 130 , 0.2 ), rgba ( 238 , 130 , 238 , 0.2 ) ); background : -webkit-gradient( linear , left center , right center , from( rgba ( 255 , 0 , 0 , 0.2 )), color-stop( 14% , rgba ( 255 , 69 , 0 , 0.2 )), color-stop( 28% , rgba ( 255 , 255 , 0 , 0.2 )), color-stop( 42% , rgba ( 0 , 128 , 0 , 0.2 )), color-stop( 56% , rgba ( 0 , 0 , 255 , 0.2 )), color-stop( 70% , rgba ( 75 , 0 , 130 , 0.2 )), to( rgba ( 238 , 130 , 238 , 0.2 )) ); } |
ちょい薄い
はっきり こいつに テキストシャドー足す
1 2 3 | .rainbow { background : -moz- linear-gradient ( left , red , orange, yellow, green , blue , indigo, violet); background : -webkit-gradient( linear , left center , right center , from( red ), color-stop( 14% , orange), color-stop( 28% , yellow), color-stop( 42% , green ), color-stop( 56% , blue ), color-stop( 70% , indigo), to(violet)); } |
1 2 3 4 5 | .text_shadow{ text-shadow : #000000 1px 1px 3px ; /* FireFox, Webkit, Opera */ -ms- filter : "progid:DXImageTransform.Microsoft.DropShadow(color=#000000,offx=1,offy=1)" ; /* IE8 */ display : block ; /* IE */ } |
いま3
1 | background : linear-gradient ( -45 deg, red , orange, yellow, green , blue , indigo, violet); |
500MBまでなら解凍できるため
2015
2016
2017
と画像フォルダを別々にアップし
画像フォルダがない状態を○○_newとしアップ
画像フォルダの先へそれぞれ解凍できるので解凍
※ wp-configだけちゃんとアップロードバージョンにかえる(ローカル設定から)
現在の名前を_backと変更して
_newを取り現在のフォルダに
phpmyadminで一応念のため現在の状態をエクスポートしてから
インポートるるる。
Login LockDown
ログイン画面に広告でるから
login.css
1 2 | /*セキュリティソフト用*/ #login #loginform p:nth-of-type( 3 ){ display : none ;} |
一定時間過ぎるとタイムアウトとなる
つまりファイルが多い 少ないで変わる
500MBの画像で何とか解凍できたが
900MBは無理だった
サクラの場合SSHが使えるから
ターミナルでSSH接続して
unzipで解凍すればよいか
圧縮も
http://uguisu.skr.jp/Windows/tar.html
参考他探す
http://webkaru.net/rental-server/sakura-ssh-login/
1 2 | $IDZ = get_the_ID(); if ( $IDZ !== 195 ): ?> |
複数記事
1 2 3 | <?php $IDZ = get_the_ID(); if ( $IDZ !== 195 && $IDZ !== 123 ): ?> |
消費税込の価格表示法
http://www.welcart.com/community/forums/topic/%E7%A8%8E%E8%BE%BC%E3%81%BF%E4%BE%A1%E6%A0%BC%E3%81%AE%E8%A1%A8%E7%A4%BA%E6%96%B9%E6%B3%95
1 2 3 4 5 6 | <?php global $usces ; $price = usces_the_itemPrice( 'return' ); //売価 $tax = $usces ->getTax( $price ); //売価×基本設定の税額(税計算方法も考慮します) echo 'With tax: ¥' . number_format( $price + $tax ); ?> |
送料についての参考
送料加算の仕組み
http://www.welcart.com/documents/topicks/%E9%80%81%E6%96%99%E5%8A%A0%E7%AE%97%E3%81%AE%E4%BB%95%E7%B5%84%E3%81%BF
配送設定
http://www.welcart.com/documents/manual-2/%E9%85%8D%E9%80%81%E8%A8%AD%E5%AE%9A#kokusaibin
カートページカスタマイズ 消費税込み
http://welcustom.net/consumption-tax-cart-page/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | $html .= usces_get_cart_rows( 'return' ); //追加コード //タックスモードなら税金と税込み表示 if ( 'exclude' == $this ->options[ 'tax_mode' ] ){ $total_price = usces_total_price( 'return' ) - usces_order_discount( 'return' ); $taxsss = $this -> getTax( $total_price ); $with_tax_price = $total_price + $taxsss ; $tax_html = '<tr> <td colspan= "5" scope= "row" class = "aright" >消費税</td><td class = "aright" >¥ '.$taxsss.' </td> <td colspan= "2" > </td></tr> <tr><td colspan= "5" scope= "row" class = "aright" >税込合計</td><td class = "aright" > ¥ '.$with_tax_price.' </td><td colspan= "2" > </td></tr> <tr><td colspan= "6" scope= "row" class = "aright" >送料別</td><td colspan= "2" > </td></tr> '; } //税込みモードなら else { $tax_html = ' <tr> <td colspan= "5" scope= "row" class = "aright" > ' . __(' total items ',' usces ') . usces_guid_tax(' return ') . ' </td> <td class = "aright" > ' . usces_crform($this->get_total_price(), true, false, ' return ') . ' </td> <td colspan= "2" > </td> </tr>'; } //追加ここまで $cart_table_footer = '</tbody> <tfoot> ' //ココも追加ね . $tax_html //まで .' </tfoot> </table> '; |
コントロールパネルからでは htaccessが入っている場合使えない
つまりワードプレスの場合駄目
だから直ざし
サーバーのURLを取得するコード
url.php
1 2 3 | <?php echo __FILE__ ; ?> |
こいつにアクセスして
こうかいた
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | AuthUserFile /export/sd210/www/jp/r/e/gmoserver/2/8/sd0467128/za-su.com/.htpasswd AuthName "Input ID and Password." AuthType Basic require valid-user # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress |
データベースのメタバリューに収まっているカスタムフィールドのデータ
必要準備がめたキーで
チェックボックすにて選択したものが入っているメタバリュー
方法は
phpmyadminで
クエリ
SQL
複合してあって・が有無が共存していたため二回実行
1 | UPDATE wp_d_temp1postmeta SET meta_value=REPLACE(meta_value, 'ワイヤレスマイク' , '・ワイヤレスマイク' )WHERE meta_key LIKE '%必要準備%' |
1 | UPDATE wp_d_temp1postmeta SET meta_value=REPLACE(meta_value, '・・ワイヤレスマイク' , '・ワイヤレスマイク' )WHERE meta_key LIKE '%必要準備%' |
戸惑ったのはデータベーステーブルがついていたため
参考URLのままでは実行されなかた。
http://okwave.jp/qa/q7916569.html
wpfilecashが入ってるとばぐる
プラグイン すべてオフ
再有効かの前に プラグインフォルダの wp file cash の cashを消す
1.データベース作成
2.ワードプレスのインストール サーバーでやる(アップしたりパーミッションの問題あるから)
2.phpmyadminインスト
フォルダ階層 wp 出す ドメイン直下 に
phpadminでサイトURL変える。
—-
wp phpmyadmin
ファイルマネージャー
サーバー情報 からいけるが解凍は出来ない模様
却下
—
のでphpmyadminファイルジラで解凍アップし phpのパーミッションをすべて700にする必要あり
参考
http://guide.onamae-server.com/sd/apps.php?c1=3&c2=12&c3=15&id=27
ファイルジラでフィルタ
phpのみを作る(ファイル名 後方一致 .php ふぁいるのみ)
フォルダ選択右クリックパーミッション700 中に含むものすべてを指定
参考
http://daredemopc.blog51.fc2.com/blog-entry-927.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 「phpmyadmin」フォルダの下に、設定ファイルを保存する「config」フォルダを作成 https: //ドメイン名/phpmyadmin/setup/ にアクセス セキュリティが警告 進む http: //guide.onamae-server.com/sd/apps.php?c1=3&c2=12&c3=15&id=28 SSL接続の推奨」の「オプション」をクリックしてデータベースとのSSL通信の設定 「セキュリティ」タブをクリックし、「SSL接続の推奨」にチェック 新しいサーバー」をクリックし、データベース設定を追加します。 このサーバーの詳細な名前 コントロールパネルで作成したデータベースの「ホスト名」 サーバのホスト名 コントロールパネルで作成したデータベースの「ホスト名」 config認証用のユーザ (空白) 「サーバー設定」タブメニューにてphpMyAdminで管理するデータベースの設定を入力し「Apply」ボタンをクリックします。 「基本設定」タブ、及び「認証」タブにてphpMyAdminで管理するデータベースの設定を入力します。 「デフォルト言語」を「日本語」に変更し、「保存する」をクリックします。 共用サーバー SDにFTP接続し、 先ほど作成した「config」フォルダの下にある「config.inc.php」ファイルを一度ダウンロードします。その後、「phpmyadmin」フォルダの下にアップロードします。 ※脆弱性対策のため、この時点で「config」フォルダのパーミッション設定を「000」に 変更してください。 設定ファイルの作成に使用した phpmyadmin/setup/index.php ファイルのパーミッション設定を「600」に変更しておきます。 https: //ドメイン名/phpmyadmin/ にアクセスし、 phpMyAdminの画面が表示されたらインストールは終了です。 以上でphpMyAdminの新規インストールは完了です。 共用サーバー SDのコントロールパネルで表示されたデータベースのユーザー名、パスワードを使ってログインしてください。 複数のデータベースを管理される方は次の データベースの追加登録 へ 進んでください。 http: //guide.onamae-server.com/sd/apps.php?c1=3&c2=12&c3=15&id=29 |
やはりさくらが一番安心
つずき
問題
データベースにローカルデータベース突っ込もうとおもったら2点
・アップロードサイズが2Mしかない
・データベーステーブル文字がちがうのかアップできない
解決
・いつものphp.iniをphpmyadminにいれたらアップサイズ増えた 安心ほ
・新しくコンパネでデータベース作って空っぽの状態にしてインポートしたらできた。
追記
・ローカルのデータベースアップするとエラーになる
多分まんまプラグインとかアップしてないからおかしいのか
プラグインの少ない方 つまりアップロード済みのデータベースをDLして
ローカルにつっこんでからならアップできた。
その前に
・zipでアップできないからプラグインを必要なものを
インスト時の状態でインストしてった20個以上 めんどい(アップでもパーミッション等あるけどだいじょぶか?)
テーマ 画像フォルダ=アップロードフォルダはファイルジラでアップす
いちおこれでローカルと同じワードプレスあがった
しかしphpmyadmin 等のセキュリティはだいじょぶか?
アーカイブページ(商品カテゴリ=親の自動チェックが効かない)でブログと同じカテゴリを使うと
表示件数が分岐できない
即席で 小津メインクエリで
1 2 3 4 | //商品カテゴリーは全件表示 if ( $query ->is_category( array ( 'item' , 'kitchen' , 'stool' , 'others' )) && $query ->is_main_query() ) { $query ->set( 'posts_per_page' , -1 ); } |
商品ページのカーかイブけんすうと
ブログ件数分けたいなら
ぶろぐをすべて親同じにするか
たくそのみーわけたほうがよいな
さらにカスタムフィールドスイートの場合コピーした時おかしくなる
welcartと相性のいいカスタムフィールドはSmart Custom Fieldsみたいだ
ウェルカートユーザーにはすべての権限を持たせたいがワードプレスの中心部を触られたくないばあい
忠告しさらに
ユーザーIDで1以外をカスタムアドミン2を読み込ます。
以下コード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | @charset "utf-8" ; #profile-page h 3 , /*#profile-page table:nth-of-type(1) tr:nth-child(1),*/ #profile-page table:nth-of-type( 1 ) tr:nth-child( 2 ), #profile-page table:nth-of-type( 1 ) tr:nth-child( 3 ), #profile-page table:nth-of-type( 1 ) tr:nth-child( 4 ), #profile-page table:nth-of-type( 1 ) tr:nth-child( 5 ), #profile-page table:nth-of-type( 2 ) tr:nth-child( 2 ), #profile-page table:nth-of-type( 2 ) tr:nth-child( 3 ), #profile-page table:nth-of-type( 2 ) tr:nth-child( 4 ), #profile-page table:nth-of-type( 2 ) tr:nth-child( 5 ), #profile-page table:nth-of-type( 3 ) tr:nth-child( 2 ), #profile-page table:nth-of-type( 3 ) tr:nth-child( 3 ), #profile-page table:nth-of-type( 3 ) tr:nth-child( 4 ), #profile-page table:nth-of-type( 3 ) tr:nth-child( 5 ), #profile-page table:nth-of-type( 4 ) tr:nth-child( 1 ), #footer-ozh-oam,#footer-upgrade { display : none ; } /* #menu-dashboard ダッシュボード #menu-posts 投稿 #menu-media メディア #menu-links リンク #menu-pages 固定ページ #menu-comments コメント #menu-appearance 外観 #menu-plugins プラグイン #menu-users ユーザー #menu-tools ツール #menu-settings 設定 .wp-menu-separator (区切り線) */ #menu-tools, #menu-plugins, #menu-settings, #menu-pages, #menu-appearance, #toplevel_page_edit-post_type-cfs, /*スイート*/ #toplevel_page_edit-post_type-acf, /*アドバンス*/ #toplevel_page_cptui_main_menu, /*CPI*/ #toplevel_page_WP-Optimize, /*オプティ*/ #toplevel_page_zencache /*全キャッシュ*/ { display : none ; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | //このcssでCSS3を使って項目見えなくする //CSSで管理画面内のサイドメニューを非表示にする 権限指定 function custom_admin_styles(){ $current_user = wp_get_current_user(); //現在のユーザー情報を取得 $user = $current_user ->ID; if ( $user !== 1){ //doggstar=1 かチェック echo '<link rel="stylesheet" type="text/css" href="' .get_bloginfo( 'template_directory' ). '/d_con/custom-admin-css2.css" />' ; } } add_action( 'admin_print_styles' , 'custom_admin_styles' , 21); //これより下はいるのか?? /* * ユーザーの権限をチェックする * @param $user ユーザーオブジェクト * @param $role ユーザー権限の文字列 * (administrator, editor, author, contributor, subscriber) */ function check_user_role( $user , $role ){ foreach ( $user ->roles as $user_role ){ if ( $user_role === $role ){ return true; } } return false; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | //WordPressのカテゴリのテンプレートで、属する親カテゴリに合わせて、 //子カテゴリの内容を切り替える関数 function in_category_family( $parent ) { if ( empty ( $parent ) ) return false; if ( in_category( $parent ) ) return true; $parent = get_category( $parent ); foreach ( (get_the_category()) as $child ) { $child = get_category( $child ->cat_ID); if ( cat_is_ancestor_of( $parent , $child ) ) return true; } return false; } //if ( function_exists('in_category_family') && in_category_family('親カテゴリのスラッグ') ){ //実行内容 //} |
どこまでいったか
写真(商品写真)をアップする方法
sol-001 が商品名なら sol-001 複数毎目はsol-001–01 (0から1へ読み込むようだから 01~09 10~19 とする)100枚はないだろ?
商品の並べ替え
ファンクション
1 2 | //順序ポスト使用 add_post_type_support( 'post' , 'page-attributes' ); |
ワードプレス4以降 複数条件でループを並び指定出来る
クエリポスト
1 | 'orderby' => array ( 'menu_order' => 'DESC' , 'date' => 'DESC' ), |
メインクエリ
1 | $query -> set( 'orderby' , array ( 'menu_order' => 'DESC' , 'date' => 'DESC' ) ); |
商品画像を出力するコード 参考http://wp-e.org/2014/09/27/5128/
通常
1 2 3 4 | <?php //商品画像 //usces_the_itemImage(0, 640, 480); ?> |
クラスなどつける
1 | <img src= "<?php usces_the_itemImageURL(0); ?>" class = "" /> |
複数画像を出力
普通
1 2 3 4 | <?php $imageid = usces_get_itemSubImageNums(); ?> <?php foreach ( $imageid as $id ) : ?> <a href= "#" ><?php usces_the_itemImage( $id , 295, 450, $post ); ?></a> <?php endforeach ; ?> |
クラス何どつける
1 2 3 4 | <?php $imageid = usces_get_itemSubImageNums(); ?> <?php foreach ( $imageid as $id ) : ?> <a href= "#" ><img src= "<?php usces_the_itemImageURL($id); ?>" class = "" /></a> <?php endforeach ; ?> |
商品編集ダイレクト ファンクション
1 2 3 4 5 6 7 8 | //アイテムページの編集をアイテム編集ページに add_filter( 'edit_post_link' , 'my_edit_post_link' ); function my_edit_post_link( $output ) { if (usces_is_item()){ $output = str_replace ( 'post.php?post' , 'admin.php?page=usces_itemedit&post' , $output ); } return str_replace ( '<a ' , '<a target="_blank" ' , $output ); } |
コード
1 | <?php edit_post_link( 'この商品を編集' , '<div class="henshu">' , '</div><div style="clear:both"></div>' ); ?> |
商品ページカレント
参考http://webutubutu.com/webdesign/2108
【検索用キー カレントメニューの作り方 親カテゴリで】
親カテゴリで分岐
ファンクション
1 2 3 4 5 6 7 8 9 10 11 | //親カテゴリで分岐 function post_is_in_descendant_category( $cats , $_post = null ) { foreach ( ( array ) $cats as $cat ) { // get_term_children() accepts integer ID only $descendants = get_term_children( (int) $cat , 'category' ); if ( $descendants && in_category( $descendants , $_post ) ) return true; } return false; } |
1 2 3 | <?php if ( in_category( '親カテゴリーのスラッグ' ) || post_is_in_descendant_category( get_term_by( 'slug' , '親カテゴリーのスラッグ' , 'category' ))): ?> カテゴリーAとこのカテゴリーを親に持つ子カテゴリーであれば表示する内容 <?php endif ; ?> |
実際こんな便利なコードができた
1 2 3 4 5 6 7 8 9 10 11 12 13 | <li<?php if (is_page( '14' ) //シングルで商品が親カテゴリーじゃない場合(親カテゴリスラッグで分岐 ファンクションコード使用) or is_single() and !post_is_in_descendant_category( get_term_by( 'slug' , 'item' , 'category' )) ) : ?> class = "current" <?php endif ; ?>><a href= "<?php echo home_url(); ?>?page_id=14" >BLOG</a></li> <li<?php if (is_page( '4' ) or in_category( 'item' ) || //親カテゴリスラッグで分岐 ファンクションコード使用 post_is_in_descendant_category( get_term_by( 'slug' , 'item' , 'category' ))): ?> class = "current" <?php endif ; ?>><a href= "<?php echo home_url(); ?>?page_id=4" >PRODUCTS</a></li> |
wp-optimize リビジョン消す
WP File Cacheはやはりはやくなるぞ!管理画面
BackWPup バックアッププラグイン
http://w3q.jp/t/1083
http://weblightenment.com/%E7%96%91%E4%BC%BC%E3%82%AF%E3%83%A9%E3%82%B9first-child%E3%81%8C%E5%8A%B9%E3%81%8B%E3%81%AA%E3%81%84%E6%99%82%E3%81%AE%E8%A7%A3%E6%B1%BA%E6%B3%95/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | <div> <h2>見出し</h2> <section> テキストテキストテキスト </section> <section> テキストテキストテキスト </section> </div> ここで私はdivに含まれている初めのsectionにだけmargin-rightを効かせたかった。 そこで私ははいつものように div{overflow:hidden;} div section{float:left;} div section:first-child{margin-right;} てな具合で記述した。 がしかし効かない。 ので調べてみると、first-childという疑似クラスは親要素(この場合div)の一番初めに記述されているのが、h2なのでsectionタグは一番初めのタグではないから効かないということらしい。 ではこの場合どうしたらよいか。。。 隣接セレクタを使う つまり div>h2+section{margin-right:10px;} とする。これでdivの子要素でh2の次のsectionタグを指定したことになる。 ちなみにsectionタグの次のsectionを指定したい時は div>section+section{margin-right:10px;} と記述する。 ちなみにこれらを教えてくれたのは http: //web-dd.net/?p=278 です。有難う。 疑似クラスにはまだまだいろいろなぞがありそうなので、今後より詳しく調べておこうと思う。 CSS3の出現によって疑似クラスも増えたし。ただブラウザによって機能しないものがまだまだあるようだ。。。 ちなみにfirst-childもIE6には対応していない。 ちなみに下のサイトいろいろ見やすくていい http: //w3g.jp/css/guide/pseudo |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <?php //親のIDをget_termsへ $args = array ( 'child_of' => 97); //子ターム一覧を取得 $dterms =get_terms( 'category' , $args ); ?> <?php foreach ( $dterms as $dterm ): ?> <!--★★★ループ基本--> <?php if ( have_posts () ) : while ( have_posts() ) : the_post(); ?> 商品 <?php endwhile ; endif ; ?> <?php wp_reset_query(); ?> <?php endforeach ; ?> |