if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_63ee81096fe01',
'title' => 'Кнопки для карточки товара',
'fields' => array(
array(
'key' => 'field_63ee810894a14',
'label' => 'Доставка',
'name' => 'delivery-info-btn',
'aria-label' => '',
'type' => 'textarea',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'maxlength' => '',
'rows' => '',
'placeholder' => '',
'new_lines' => '',
),
array(
'key' => 'field_63ee822694a15',
'label' => 'Оплата',
'name' => 'payment-info-btn',
'aria-label' => '',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'maxlength' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'product',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => 0,
));
endif;
<button class="accordion">Доставка</button>
<div class="panel">
<p><?php the_field('delivery-info-btn); ?></p>
</div>
<button class="accordion">Оплата</button>
<div class="panel">
<p><?php the_field('payment-info-btn); ?></p>
</div>
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
background-color: white;
display: none;
overflow: hidden;
}
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("active");
/* Toggle between hiding and showing the active panel */
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
});
}
'field_name' => get_field('acf-field'),
<div class="modal-body">
<p class="" id="postModalField"></p>
</div>
$('#postModal .modal-body #postModalField').html(response.field_name);
<?php
$args = array(
'taxonomy' => 'category',
'hide_empty' => true,
'exclude' => [1,], // исключаем рубрики которые не нужны (1 - без рубрики)
);
$terms = get_terms( $args );
if ( $terms ) {
foreach( $terms as $term ) {
$args = array(
'posts_per_page' => 9, // количество записей на странице
'post_type' => 'catalog', // указываем нужный слаг посттайпа
'post_status' => 'publish', // только опубликованные записи
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => '100',
'terms' => $term->term_id
)
)
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
echo '<div class="row">
<div class="col"><h2>' . $term->name . '</h2></div> // Название рубрики
</div>
echo '<table>';
echo '<thead>';
echo '<tr >';
echo '<th>Название</th>';
echo '<th>Характеристика</th>';
......
echo '</tr>';
echo '</thead>';
while ( $query->have_posts() ) {
$query->the_post();
echo '<tbody>';
echo '<tr>';
echo '<td>'. get_the_title() . '</td>'; // Заголовок поста
echo '<td>' . get_field('film_color',$post->ID) . '</td>'; // вывод нужного поля ACF
......
echo '</tr>';
echo '</tbody>';
}
echo '</table>';
} else {
}
}
}
?>
<? ob_start();
$APPLICATION->IncludeComponent(
"bitrix:catalog.smart.filter",
"",
array(
......
"SECTION_ID" => $_REQUEST["SECTION_ID"],///передать id раздела в умный фильтр
......
),
$component,
array('HIDE_ICONS' => 'Y')
);
$GLOBALS['smart_filter'] = ob_get_contents();
ob_end_clean();
?>
<?=$GLOBALS['smart_filter']?>