Skip to content

Instantly share code, notes, and snippets.

// ログイン画面のロゴ変更
function login_logo() {
echo '<style type="text/css">.login h1 a {background-image: url('.get_bloginfo('template_directory').'/images/login-logo.png);width:●●px;height:●●px;background-size:●●px ●●px;}</style>';
}
add_action('login_head', 'login_logo');
// ログイン画面のロゴURL
function custom_login_logo_url() {
return get_bloginfo( 'url' );
}
// デフォルトテーマのCSSを読み込まないようにします
add_action('wp_enqueue_scripts', function () {
$styles = wp_styles();
$styles->add_data('twentytwenty-style', 'after', array());
}, 20);
function custom_date(){
$date = get_the_time('Ymd');
$y = get_the_time('Y');
$m = get_the_time('n');
$d = get_the_time('j');
//昭和
if($date < 19890108){
if($y == 1926){
echo "昭和元年";
//タクソノミーによって条件分岐させる場合
<?php if(is_tax("タクソノミー名")): ?>
//処理を記載
<?php endif; ?>
//タームによって条件分岐させる場合
<?php if(is_tax("タクソノミー名", "ターム名")): ?>
//処理を記載
<?php endif; ?>
<?php
$custom_posts = get_posts(array(
'post_type' => 'カスタム投稿タイプスラッグ', // 投稿タイプ
'posts_per_page' => 6, // 表示件数
'orderby' => 'date', // 表示順の基準
'order' => 'DESC', // 昇順・降順
'tax_query' => array(
array(
'taxonomy' => 'タクソノミースラッグ', //タクソノミーを指定
'field' => 'slug', //ターム名をスラッグで指定する
$(function () {
var swiperSlide = $(this).find('.top_pickup_list_item');
var loopflag = false;
if (swiperSlide.length >= 4) {
loopflag = true;
}
var swiper = new Swiper('.swiper-container', {
spaceBetween: 30,
breakpoints: {
768: {
<ul class="g_nav">
<li class="g_nav_item menu_single"><a href="#" class="init-bottom">BRANDS</a>
<ul class="menu_second_level">
<li class="menu_second_level_item"><a href="#">KOBEDO</a></li>
<li class="menu_second_level_item"><a href="#">COUNTRY</a></li>
<li class="menu_second_level_item"><a href="#">KOBEDOG</a></li>
</ul>
</li>
</ul>
jQuery(function($) {
//data-hrefの属性を持つtrを選択しclassにclickableを付加
$('tr[data-href]').addClass('clickable')
//クリックイベント
.click(function(e) {
//e.targetはクリックした要素自体、それがa要素以外であれば
if(!$(e.target).is('a')){
// アニメーション対象
const targetElements = document.querySelectorAll(".js-ObserveAnimationTarget");
const observeAnimation = () => {
if (!targetElements.length) return;
const handleObserve = entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.setAttribute("data-animated", "true");
.hoge {
text-shadow: 0 0 25px #edf8ff, 0 0 20px #edf8ff, 0 0 0.4px #edf8ff;
}