<?php
$args = array(
'role__in' => array( 'administrator', 'author', 'editor' ),
'orderby' => 'display_name',
'order' => 'ASC',
'number' => '6',
);
$authors = get_users( $args );
?>
<?php foreach ( $authors as $author ) :
$user_id = $author->ID;
$phone_number = get_field('user_phone', 'user_'. $user_id);
$phone_number_trimmed = preg_replace("/[^0-9]/", '', $phone_number);
?>
<article class="author">
<?php if ( $phone_number ) : ?>
<a href="<?php echo $phone_number_trimmed ?>" class="user-phone"><?php echo $phone_number ?></a>
<?php endif ?>
</article>
<?php endforeach; ?>
function your_theme_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar Shop', 'your_theme' ),
'id' => 'sidebar-shop',
'description' => esc_html__( 'Sidebar for shop', 'your_theme' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'your_theme_widgets_init' );
add_filter( 'woocommerce_shop_loop_subcategory_title', 'add_text_before_cat_title', 15 );
function add_text_before_cat_title( $category ) {
$slug = $category->slug;
if ( $slug === 'decor' ) {
echo 'from 10500 $';
} elseif ( $slug === 'music' ) {
echo 'from 5600 $';
} else {
return;
}
}
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );
function cw_change_product_price_display( $price ) {
// Your additional text in a translatable string
$text = __('от');
// returning the text before the price
return $text . ' ' . $price;
}
<?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();
?>
<?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; ?>
<?php
// для гутенберг блока
$quote = get_field('quote');
// для блока гибкого содержимого
if ( get_row_layout() == 'testimonial' ){
$quote = get_sub_field('quote');
}
?>
<div class="acf-block-testimonial">
<blockquote><?php echo $quote; ?></blockquote>
</div>