Skip to content

Instantly share code, notes, and snippets.

View Olein-jp's full-sized avatar
🏠
Working from home

Koji Kuno Olein-jp

🏠
Working from home
View GitHub Profile
add_filter( 'widget_tag_cloud_args', 'my_widget_tag_cloud_args');
function my_widget_tag_cloud_args( $args) {
$args = array(
'smallest' => 10, // 最小のフォントサイズ:8[デ]
'largest' => 15, // 最大のフォントサイズ:22[デ]
'unit' => // フォントサイズ単位:'pt'[デ] CSSで使用できる単位pt, px, em, %
'number' => 20, // 表示タグ数の上限:45[デ]
'format' => // 表示フォーマット:'flat'(横並び)[デ]、'list'(縦並び <li></li>)、'array'(表示されない。他のPHPコード用に使用する場合)
'separator' => // 表示タグ毎の区切り '\n'[デ] (スペース)
'orderby' => // 並び替項目 'name'[デ](タグ名)、'count'(投稿数)
<div class="map-wrap">
<iframe src="https://maps.google.co.jp/maps?output=embed&q=ここに住所が入ります&z=16" width="1000" height="400" frameborder="0" scrolling="no" ></iframe>
<!--パラメータは適時変更してください -->
</div>
.is-sticky {
position: -webkit-sticky;
position: sticky;
top: 0;
}
<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">
<?php if ( function_exists( 'bcn_display' ) ) {
bcn_display();
}?>
</div>
<?php echo do_shorcode( '[mwform_formkey slug="form-contact"]' ); ?>
if ( window.matchMedia( '(min-width: 600px)' ).matches){
//画面幅600px以下の場合の処理
} else {
// それ以外の処理
}
// 3 col
.container::after{
content:"";
display: block;
width:30%;
}
// 4 col
.container::before{
content:"";
<?php
$prev_post = get_previous_post();
$next_post = get_next_post();
/*
同じカテゴリーに属する記事だけをナビゲートしたい場合には、
previous_post_link('<div class="p-posts-navigation__item previous">%link</div>','%title', true );
第3引数にtrueを入れる
参照:https://www.nxworld.net/wordpress/wp-navigation-in-same-term.html
*/
if( $next_post || $prev_post ) :
<?php
$parent_id = $post->ancestors[count($post->ancestors) - 1]; // 最上の親ページのIDを取得
echo $parent_slug = get_post($parent_id)->post_name; // 最上の親ページのスラッグを取得して表示
echo $parent_title = get_post($parent_id)->post_title; // 最上の親ページのタイトルを取得して表示
echo get_permalink($parent_id); // 最上の親ページの URL を表示
?>
@Olein-jp
Olein-jp / tab.html
Last active November 25, 2019 04:34
<ul class="information-tabs">
<li class="information-tabs__item is-active">tab1</li>
<li class="information-tabs__item">tab2</li>
<li class="information-tabs__item">tab3</li>
</ul>
<ul class="information-contents">
<li class="information-contents__item is-show">Content1</li>
<li class="information-contents__item">Content2</li>
<li class="information-contents__item">Content3</li>
</ul>