$term = get_queried_object();
$my_gallery = get_field('my_gallery', $term);
echo do_shortcode($my_gallery);
function archive_product_shortcode() {
$term = get_queried_object();
if ( function_exists('get_field') ) {
$my_shortcode = get_field('my_shortcode', $term);
echo do_shortcode( $my_shortcode );
}
}
add_action('woocommerce_archive_description', 'archive_product_shortcode', 20 );
// Слайдер внутри отзывов
$('.review-slide').each(function(index){
$(this).addClass('review-slide-' + index);
var indexClass = '.review-slide-' + index;
$(indexClass + ' .review-inner-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
asNavFor: indexClass + ' .review-inner-slider-thumb',
});
$(indexClass + ' .review-inner-slider-thumb').slick({
arrows: false,
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: indexClass + ' .review-inner-slider',
dots: false,
focusOnSelect: true,
});
});
document.addEventListener('DOMContentLoaded', function() {
let $btn = document.querySelector('.modal-open');
let $input = document.querySelector('#search_query');
$btn.addEventListener('click', function() {
setTimeout(function(){
$input.focus();
}, 100);
});
});
<?php
$args = array(
'numberposts' => 4,
'category' => 18,
'post_status' => 'publish',
);
$result = wp_get_recent_posts( $args );
foreach( $result as $post ){
setup_postdata( $post );
?>
<article>
<span><?php the_date('j F Y') ?></span>
<h4><?php the_title() ?></h4>
<?php the_excerpt() ?>
<a href="<?php the_permalink() ?>" class="research-link"></a>
</article>
<?php
}
wp_reset_postdata();
?>
$params = array(
'posts_per_page' => 12,
'post_type' => array('product', 'product_variation'),
'meta_query' => array(
array(
'key' => '_stock_status',
'value' => 'outofstock'
)
)
);
$wc_query = new WP_Query($params);
if ($wc_query->have_posts()) :
while ($wc_query->have_posts()) : $wc_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile;
wp_reset_postdata();
else: ?>
<p><?php _e( 'No Products' );?></p>
<?php endif; ?>
<?php the_posts_pagination() ?>
<?php if ( have_rows( 'repeater' ) ) : ?>
<?php while ( have_rows( 'repeater' ) ) : the_row();
$name = get_sub_field( 'name' );
$is_show = get_sub_field( 'is_show' );
?>
<?php if ( $is_show ) : ?>
<?php if ( $name ) : ?>
<?php echo esc_html( $name ); ?>
<?php endif; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>