$('.grid').isotope('reloadItems').isotope();
</div>
<!-- entry-box -->
<?php get_template_part( 'inc/template/related-posts' ); ?>
<!-- related-post -->
<?php comments_template(); ?>
</div>
<!-- widget-area-4 -->
<?php get_template_part( 'inc/template/related-posts' ); ?>
<?php $product->list_attributes(); ?>
используется метот list_attributes(); Можно на этом остановиться и в своем шаблоне написать global $product;
$product->list_attributes();
public function list_attributes() {
wc_get_template( 'single-product/product-attributes.php', array(
'product' => $this
) );
}
$attributes = $product->get_attributes();
.........
<?php foreach ( $attributes as $attribute ) :
if ( empty( $attribute['is_visible'] ) || ( $attribute['is_taxonomy'] && ! taxonomy_exists( $attribute['name'] ) ) ) {
continue;
} else {
$has_row = true;
}
?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<th><?php echo wc_attribute_label( $attribute['name'] ); ?></th>
<td><?php
if ( $attribute['is_taxonomy'] ) {
$values = wc_get_product_terms( $product->id, $attribute['name'], array( 'fields' => 'names' ) );
echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );
} else {
// Convert pipes to commas and display values
$values = array_map( 'trim', explode( WC_DELIMITER, $attribute['value'] ) );
echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );
}
?></td>
</tr>
<?php endforeach; ?>
if( $my_query->have_posts() ) {
echo '<ul>';
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php
}
echo '</ul>';
}
if( $my_query->have_posts() ) {
echo '<div class="grid">';
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<div class="grid-item">
<div class="overwrap-images">
<a href="<?php the_permalink();?>"><?php the_post_thumbnail();?></a>
<div class="overwrap-date">
<a href="<?php the_permalink();?>" class="date"><?php the_date('d/m/Y');?></a>
<h3><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
<p class="desc">
<?php the_excerpt();?>
</p>
</div>
</div>
</div>
<?php
}
echo '</div>';
}
woocommerce_mini_cart();
echo WC()->cart->get_cart_contents_count();
<option>
кастомизировать нельзя. Есть JS библиотеки, типа такой selectric.js.org<?php
/**
* Template Name: Название шаблона
*/
add_action('init', 'do_rewrite');
function do_rewrite(){
add_rewrite_rule( '^avtori/([^/]*)/([^/]*)/?', 'srt=$matches[1]', 'top' );
add_filter( 'query_vars', function( $vars ){
$vars[] = 'srt';
return $vars;
} );
}
$my_var = get_query_var('srt');
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#projects" aria-controls="projects" role="tab" data-toggle="tab">Все проекты</a></li>
<?php
$args = array(
'taxonomy' => 'afisha_kat',
'hide_empty' => true,
);
$terms = get_terms( $args );
foreach ($terms as $term) { ?>
<li role="presentation"><a href="#<?php echo $term->slug;?>" aria-controls="<?php echo $term->slug;?>" role="tab" data-toggle="tab"><?php echo $term->name; ?></a></li>
<?php }?>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="projects">
<?php
$args = array(
'post_type' => 'afisha',
'posts_per_page' => 8,
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<a href="<?php the_permalink();?>">
<figure class="project-thumb">
<?php the_post_thumbnail()?>
</figure>
<p class="project-descr">
<?php the_title();?>
</p>
</a>
<?php endwhile; ?>
</div>
<?php
endif; wp_reset_postdata(); ?>
</div>
<?php
$args = array(
'taxonomy' => 'afisha_kat',
'hide_empty' => true,
);
$terms = get_terms( $args );
foreach ($terms as $term) { ?>
<div role="tabpanel" class="tab-pane" id="<?php echo $term->slug;?>">
<div class="projects-grid">
<ul class="project-tabs-items">
<?php
$args = array(
'post_type' => 'afisha',
'posts_per_page' => 3,
'tax_query' => array(
array(
'taxonomy' => 'afisha_kat',
'field' => 'slug',
'terms' => $term->slug,
)
)
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<li>
<a href="<?php the_permalink();?>">
<figure class="project-thumb">
<?php the_post_thumbnail('project-thumb')?>
</figure>
<p class="project-descr">
<?php the_title();?>
</p>
</a>
</li>
<?php endwhile; ?>
<?php
endif; wp_reset_postdata(); ?>
</ul>
</div>
</div>
<?php } ?>
</div>