$product = wc_get_product(get_the_ID());
$id = $product->get_id();
$sku = $product->get_sku();
<a href="?add-to-cart=<?php echo $id; ?>" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="<?php echo $id; ?>" data-product_sku="<?php echo $sku; ?>"></a>
$(".btn").click(function () {
$(this).parent().prevAll().find(".menu").removeClass("active");
$(this).parent().nextAll().find(".menu").removeClass("active");
$(this).next().toggleClass("active");
});
.menu.active {
display: block;
}
<?php
$page_children = new WP_Query( array(
'post_type' => 'page',
'post_parent' => get_the_ID() // id текущей
));
if($page_children->have_posts()) {
while($page_children->have_posts()){
$page_children->the_post();
?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php }
}
wp_reset_query();
?>