これまでは、
<?php the_field('field_name'); ?>
これからは
<?php echo get_field('field_name'); ?>
WordPress 2024.3.19
これまでは、
<?php the_field('field_name'); ?>
これからは
<?php echo get_field('field_name'); ?>
jQuery 2024.3.13
/* ===============================================
# faq
=============================================== */
jQuery(function ($) {
$(".question").on("click", function () {
/*クリックでコンテンツを開閉*/
$(this).next().slideToggle(200);
/*矢印の向きを変更*/
$(this).toggleClass("open", 200);
});
});
/* ===============================================
# faq 排他処理
=============================================== */
$(function() {
$('.question').click(function() {
$(this).toggleClass('open');
$(this).next().slideToggle();
$('.question').not($(this)).next().slideUp();
$('.question').not($(this)).removeClass('open');
});
});
WordPress 2024.3.5
functions.phpに以下を追加する
add_filter( 'wp_kses_allowed_html', 'acf_add_allowed_iframe_tag', 10, 2 );
function acf_add_allowed_iframe_tag( $tags, $context ) {
if ( $context === 'acf' ) {
$tags['iframe'] = array(
'src' => true,
'height' => true,
'width' => true,
'frameborder' => true,
'allowfullscreen' => true,
);
}
return $tags;
}
<?php
$acfgroup = get_field('group');
$judge = array_filter($acfgroup);
if(!empty($judge)):
endif;
?>
<script>
$(document).ready(function () {
$('form').attr('action', function (i, val) {
return val + '#section';
});
});
</script>
WordPress 2023.11.6
<?php wp_head(); ?> 下に入れる
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
jQuery 2023.10.29
$(window).scroll(function() {
var height = $(window).height();
if ($(window).scrollTop() > height) {
$('header').addClass('is-show');
} else {
$('header').removeClass('is-show');
}
});
WordPress 2023.10.3
thanksページを作りたくないのでパラメータを付ける
functions.php
function my_mwform_after_send( $Data ) {
if ( $Data->get_form_key() === 'mw-wp-form-xxx' ) {
$id = $Data->get( 'id' ); $url = get_permalink($id);
wp_redirect($url.'?q=thanks');
exit;
}
}
add_action( 'mwform_after_send_mw-wp-form-xxx', 'my_mwform_after_send' );
未分類 2023.7.4
$(function(){
var sliderShow = $('.slider');
sliderShow.slick({
arrows:true,
});
$('.tab').click(function () {
sliderShow.slick('setPosition');
});
});
HTML 2023.6.21
SimpleBarで解決