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
var pagetop = $('#page_top'); //ボタンを指定
pagetop.hide();
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
pagetop.fadeIn();
} else {
pagetop.fadeOut();
}
});
.table-wrap {
display: block;
overflow-x: scroll;
white-space: nowrap;
overflow-scrolling: touch;
}
<div id="modal-id" class="modal modal-open">
<button class="modal-close">X</button>
</div>
$('.p-faq__dt').on( 'click', function() {
$(this).next().slideToggle();
$(this).toggleClass( 'is-open' );
});
$ wp plugin install debug-bar query-monitor log-deprecated-notices monster-widget developer theme-check --activate
@Olein-jp
Olein-jp / index.php
Last active November 27, 2019 00:48
<header
class="hogehoge"
<?php if ( has_post_thumbnail() ) : ?>
style="background-image: url(<?php echo wp_get_attachment_url( get_post_thumbnail_id() ); ?>)"
<?php endif; ?>
>
@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>
<?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 を表示
?>
<?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 ) :
// 3 col
.container::after{
content:"";
display: block;
width:30%;
}
// 4 col
.container::before{
content:"";