<?php
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
$args = array(
'post_type' => 'product',
'product_cat' => 'cat-1',
'paged' => $paged,
'orderby' => 'date'
);
$my_query = new WP_Query($args);
$counter = 0;
while ($my_query->have_posts()) :
$my_query->the_post();
?>
<a data-slide-index="<?php echo $counter; ?>"> </a>
<?php
$counter++;
endwhile;
wp_reset_query();
?>
add_filter('post_gallery', 'dco_post_gallery', 10, 3);
function dco_post_gallery($output, $attr, $instance) {
$_attachments = get_posts(array('include' => $attr['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $attr['order'], 'orderby' => $attr['orderby']));
$attachments = array();
foreach ($_attachments as $key => $val) {
$attachments[$val->ID] = $_attachments[$key];
}
if (empty($attachments)) {
return '';
}
ob_start();
foreach ($attachments as $id => $attachment) :
$full = wp_get_attachment_image_url($id, 'full');
$thumbnail = wp_get_attachment_image_url($id, 'thumbnail');
$alt = $attachment->post_excerpt;
?>
<a class="gallery__item f__col" href="<?php echo $full; ?>">
<img src="<?php echo $thumbnail; ?>" class="gallery__item__img" alt="<?php echo esc_attr($alt); ?>" />
</a>
<?php
endforeach;
return ob_get_clean();
}
add_shortcode('test', 'get_test');
function get_test ($atts) {
ob_start();
?>test<?php
the_title();
return ob_end_clean();
}
add_action('customize_register', function($customizer){
$customizer->add_section(
'theme_settings',
array(
'title' => 'Theme Settings',
'priority' => 35,
)
);
$customizer->add_setting('img-upload1');
$customizer->add_control(
new WP_Customize_Image_Control(
$customizer,
'img-upload1',
array(
'label' => 'Загрузка маленького логотипа',
'section' => 'theme_settings'
)
)
);
$customizer->add_setting('img-upload2');
$customizer->add_control(
new WP_Customize_Image_Control(
$customizer,
'img-upload2',
array(
'label' => 'Загрузка большого логотипа',
'section' => 'theme_settings'
)
)
);
По этому точно не ошибка в коде.
<?php
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
?>
<?php if( have_rows('model-wrp', $taxonomy . '_' . $term_id) ): ?>
<?php while( have_rows('model-wrp', $taxonomy . '_' . $term_id) ): the_row();
// vars
$modelPassport = get_sub_field('model-passport');
$modelRecomendation = get_sub_field('model-recomendation');
$modelPreview = get_sub_field('model-preview');
?>
<div class="series__item-links">
<?php if( $modelPassport ): ?>
<a href="<?php echo $modelPassport; ?>">Ссылка №1</a>
<?php endif; ?>
<?php if( $modelRecomendation ): ?>
<a href="<?php echo $modelRecomendation; ?>">Ссылка №2</a>
<?php endif; ?>
<?php if( $modelPreview ): ?>
<a href="<?php echo $modelPreview; ?>">Ссылка №3</a>
<?php endif; ?>
</div>
<?php endwhile; ?>
<?php endif; ?>