縦長画像 横長画像 判別

function imgAddClass(imgArr){
  if(imgArr.length > 0){
    for (let i = 0; i < imgArr.length; i++) {
      var e = imgArr[i];
      var width = e.naturalWidth;
      var height = e.naturalHeight;

      if(width < height){
        e.classList.add('tate');
      }else{
        e.classList.add('yoko');
      }
    }
  }
}

//判定したい要素を指定
var imgs = document.querySelectorAll('.image');

window.addEventListener('load', function(){
  imgAddClass(imgs);
});

CSSでスクロールバーを装飾する

.scroll {
    overflow: auto;

    &::-webkit-scrollbar {
        width: 3px;
    }

    &::-webkit-scrollbar-track {
        background-color: #f0f0f0;
    }

    &::-webkit-scrollbar-thumb {
        background-color: #999;
        border-radius: 0;
    }
}

WordPressの先頭に固定表示が効かない

WP_Queryでカテゴリ絞り込みを使うと効かない模様

以下のように「’ignore_sticky_posts’ => false」を付けるとうまくいきます。

$args = array(
    'post_type'      => 'post', // 投稿タイプ
    'posts_per_page' => 10,     // 表示件数
    'ignore_sticky_posts' => false, // 先頭固定表示を有効にする
);
$the_query = new WP_Query( $args );

if ( $the_query->have_posts() ) {
    while ( $the_query->have_posts() ) {
        $the_query->the_post();
        ?>
<---  記事の表示 -->
        <?php
    }
    wp_reset_postdata();
} else {
    // 記事が見つからない場合の処理
}

[CSS]背景マーカー改行

background: linear-gradient(transparent 60%, #63A0DA 0%);
display: inline;
padding: 5px;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;


Warning: Undefined variable $additional_loop in /home/xs271582/amezo.net/public_html/wp-content/themes/amezo/index.php on line 47

Warning: Attempt to read property "max_num_pages" on null in /home/xs271582/amezo.net/public_html/wp-content/themes/amezo/index.php on line 47