忍者ブログ
29 March

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

01 August

WP4.5.2で今までのスムーススクロールが効かなくなる

http://moralhazard.jp/2016/03/25/wp-error-jquery112/
https://xakuro.com/blog/javascript/321


これをコピペする
アコーディオンパネルやタブ等の、ページ内リンクとのバッティグも防いでると思う
ありがたい!!

<script type="text/javascript">
(function($){
 
jQuery(function() {
jQuery('a[href^="#"]:not([href$="#"])').click(function() {
var href = $(this).attr('href');
var pos = $(href).offset().top;
var duration = 200;
jQuery('body, html').animate({ scrollTop: pos }, duration, 'swing');
return false;
});
});
 
})(jQuery);
</script>
PR
06 October

cf7 LPコピペ用コード

<table class="cf7">
  <tr>
    <th>社名</th>
    <td>[text your-company] </td>
  </tr>
  <tr>
    <th>担当者名</th>
    <td>[text your-name akismet:author class:small] </td>
  </tr>
  <tr>
    <th>業種</th>
    <td>[text your-gyoushu class:small] </td>
  </tr>
  <tr>
    <th>売上高</th>
    <td>[text your-uriage class:small] 万円</td>
  </tr>
  <tr>
    <th>郵便番号<span class="req">*</span></th>
    <td>[text* zip id:zip class:small] </td>
  </tr>
  <tr>
    <th>都道府県<span class="req">*</span></th>
    <td>[select* pref id:pref include_blank "北海道" "青森県" "岩手県" "宮城県" "秋田県" "山形県" "福島県" "茨城県" "栃木県" "群馬県" "埼玉県" "千葉県" "東京都" "神奈川県" "新潟県" "富山県" "石川県" "福井県" "山梨県" "長野県" "岐阜県" "静岡県" "愛知県" "三重県" "滋賀県" "京都府" "大阪府" "兵庫県" "奈良県" "和歌山県" "鳥取県" "島根県" "岡山県" "広島県" "山口県" "徳島県" "香川県" "愛媛県" "高知県" "福岡県" "佐賀県" "長崎県" "熊本県" "大分県" "宮崎県" "鹿児島県" "沖縄県"]</td>
  </tr>
  <tr>
    <th>市町村区・番地等<span class="req">*</span></th>
    <td class="address-100">[text* addr id:addr]</td>
  </tr>
  <tr>
    <th>お電話番号<span class="req">*</span></th>
    <td>[tel* tel-17 class:small]</td>
  </tr>
  <tr>
    <th>日中連絡先</th>
    <td>[tel tel-noon class:small]<br>日中連絡の付きやすい携帯電話番号などをご記入ください。</td>
  </tr>
  <tr>
    <th>FAX番号</th>
    <td>[tel tel-fax class:small]</td>
  </tr>
    <tr>
    <th>メールアドレス<span class="req">*</span></th>
    <td>[email* your-email akismet:author_email class:small]</td>
  </tr>
  <tr>
    <th>ご希望</th>
    <td>[checkbox checkbox-572 use_label_element "無料見積もり" "無料現地相談" "無料点検" "無料相談" "その他"]
</td>
  </tr>
 
  <tr>
    <th>お急ぎのお客様</th>
    <td>[checkbox checkbox-busy use_label_element "お急ぎのお客様はこちらにチェックを入れて下さい。"]
</td>
  </tr>
 
 <tr>
    <th>備考欄</th>
    <td>[textarea textarea-690]
</td>
  </tr>
</table>
<div class="doui">[acceptance acceptance-419] 上記内容をご確認していただきチェックを入れてください [/acceptance]</div>
<p class="text-xs-center">[submit]</p>



社名:[your-company]
担当者名:[your-name]
業種:[your-gyoushu]
売上高:[your-uriage] 万円

郵便番号:[zip]
都道府県:[pref]
市町村区・番地等:[addr]
お電話番号:[tel-17]
日中連絡先:[tel-noon]
FAX番号:[tel-fax]
メールアドレス:[your-email]

お問い合わせ項目:[checkbox-572]
急ぎのお客様:[checkbox-busy]

ご相談内容:
[textarea-690]



<?php if(is_page('25')): ?>
<!-- ajaxzip 住所自動入力-->
<script src="https://ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>
<script type="text/javascript">
jQuery(function(){
  jQuery('#zip').keyup(function(event){
    AjaxZip3.zip2addr(this,'','pref','addr');
  })
})
</script>
<?php endif; ?>


/* contact */
.wpcf7{
    border:none!important;
    background:none!important;
   
}
.cf7{
    max-width:900px;
    margin:0 auto!important;
}
.cf7 .small{
    max-width:300px;
}
.post_content th {
    background: #dcedff;
    vertical-align:middle;
    background:none;
   
   
}
.post_content th {
    background:#DCEDFF;

}
.post_content th {
    background:#DCEDFF;
    border: 1px solid #fff;
}
.post_content td, .post_content th {
        padding: 10px 15px 10px;

}

.post_content td {
        border: 1px solid #DCEDFF

}

/*.post_content tr {
    border-top:1px solid #DCEDFF;
    border-bottom:1px solid #DCEDFF;
}
*/
.req{
    font-weight:bold;
    color:red;
}

.wpcf7 textarea {
    height: 150px;
}

.wpcf7 input.wpcf7-submit{
     display:inline-block;
    width: 120px!important;
    background: #ffbb57;
    margin: 0 5px!important;
     height: auto;
    margin: 0 5px!important;
    border-radius:3px!important;
    color:#fff!important;
    letter-spacing:2px!important;
        height: 48px;
                vertical-align:top;

}

.text-xs-center{
    text-align:center;
}
.text-xs-center input[type="submit"], .text-xs-center input[type="reset"],.text-xs-center input[type="button"] {
    width: 120px!important;
    padding: 10px 15px!important;
    background: #ffbb57;
    margin: 0 5px!important;
    border:none!important;
    border-radius:3px!important;
    color:#fff!important;
    letter-spacing:2px!important;
        height: 48px;
        vertical-align:top;
}
.text-xs-center input[type="submit"]{
    display:inline-block;
        vertical-align:top;
}
.text-xs-center input[type="submit"]:hover, .text-xs-center input[type="reset"]:hover, .text-xs-center input[type="button"]:hover{
    opacity:0.8;
cursor:pointer;
}
.wpcf7 input.wpcf7-submit:hover {
    background-color: #ffbb57!important;
}
18 July

ACF ACFの入力欄にショートコードを入れて展開させたい

https://www.sensitivity.jp/wordpress/advanced-custom-fields%E3%81%A7%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%85%A5%E5%8A%9B/
https://midorinz.com/app/2019/04/06/advanced-custom-field%e3%81%a7%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%b3%e3%83%bc%e3%83%89%e3%82%92%e5%85%a5%e5%8a%9b%e3%81%97%e3%81%9f%e3%81%84/

ありがたいコード


<?php
echo apply_filters('the_content', get_post_meta($post->ID, 'カスタムフィールド名', true));
?>


普通にいれるとカッコ付きのままでてくる
展開させるには上記コードでやるとok
すごい簡単でありがたい!
31 March

サイトヘルスを消す

ダッシュボード、ツールのサイトヘルスをけす
ダッシュボードのyoast SEOをけす
別に放置していても問題ないことばっかりなのにいちいちうるせーサイトヘルス
曖昧に警告ばっかしやがってこっちが面倒なんだよ
だから全て消す!!!


/*----------------------------------------------------------*/
//
// いらないものを消す
//
/*---------------------------------------------------------*/
add_action('wp_dashboard_setup', function() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_site_health']);
});
add_action('admin_menu', function() {
    remove_submenu_page('tools.php', 'site-health.php');
});
add_action('wp_dashboard_setup', 'remove_wpseo_dashboard_overview' );
function remove_wpseo_dashboard_overview() {
  // In some cases, you may need to replace 'side' with 'normal' or 'advanced'.
  remove_meta_box( 'wpseo-dashboard-overview', 'dashboard', 'side' );
}
add_filter( 'site_status_should_suggest_persistent_object_cache', '__return_false' );
28 March

CF7 完了ページへとばす

ありがたいコードをコピペ
https://web-dev.tech/wordpress/plugin/contact-form-7-thanks-page/


<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
  location = 'ここに完了ページのURLを記入';
}, false );
</script>