YL

Professional Audio Solutions

Our Product

Collections

Discover our comprehensive range of premium headphones and earphones. From TWS to gaming, each product combines cutting-edge technology with superior comfort.


“product”,
“posts_per_page” => 12,
“orderby” => “date”,
“order” => “DESC”,
“paged” => $paged
);

if ($category !== “all”) {
$args[“tax_query”] = array(
array(
“taxonomy” => “product_cat”,
“field” => “slug”,
“terms” => $category
)
);
}

$products_query = new WP_Query($args);

ob_start();

if ($products_query->have_posts()) :
while ($products_query->have_posts()) : $products_query->the_post();
$product_cats = get_the_terms(get_the_ID(), “product_cat”);
$cat_slugs = array();
if ($product_cats && !is_wp_error($product_cats)) {
foreach ($product_cats as $cat) {
$cat_slugs[] = $cat->slug;
}
}
$cat_classes = !empty($cat_slugs) ? “product-item ” . implode(” “, array_map(“esc_attr”, $cat_slugs)) : “product-item”;

$acf_image = function_exists(“get_field”) ? get_field(“featured_image”) : null;
$thumb_id = has_post_thumbnail() ? get_post_thumbnail_id() : 0;

$image_html = “”;
if ($thumb_id) {
$alt = get_post_meta($thumb_id, “_wp_attachment_image_alt”, true) ?: get_the_title();
$image_html = wp_get_attachment_image($thumb_id, “large”, false, array(
“loading” => “lazy”,
“decoding” => “async”,
“alt” => esc_attr($alt),
“class” => “w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-500”,
“sizes” => “(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw”
));
} elseif (is_array($acf_image) && !empty($acf_image[“url”])) {
$alt = $acf_image[“alt”] ?? get_the_title();
$image_html = ‘' . esc_attr($alt) . '‘;
} elseif (is_string($acf_image) && $acf_image) {
$image_html = ‘' . esc_attr(get_the_title()) . '‘;
} else {
$image_html = ‘' . esc_attr(get_the_title()) . '‘;
}

$cat_badge = “”;
if ($product_cats && !is_wp_error($product_cats)) {
$cat_badge = ‘

‘ . esc_html($product_cats[0]->name) . ‘

‘;
}

$excerpt_html = “”;
if (has_excerpt()) {
$excerpt_html = ‘

‘ . esc_html(get_the_excerpt()) . ‘

‘;
}

$features_html = “”;
if (function_exists(“get_field”)) {
$features = get_field(“key_features”);
if ($features && is_array($features)) {
$features_html .= ‘

‘;
foreach (array_slice($features, 0, 3) as $feature) {
$features_html .= ‘‘ . esc_html($feature) . ‘‘;
}
$features_html .= ‘

‘;
}
}

echo <<

{$image_html}

{$cat_badge}

{esc_html(get_the_title())}

{$excerpt_html}

{$features_html}


{esc_html(get_the_date())}


View Details


HTML;
endwhile;

if ($products_query->max_num_pages > 1) {
echo ‘

‘;

for ($i = 1; $i <= $products_query->max_num_pages; $i++) {
$params = http_build_query(array_filter([
“block_id” => $block_id,
“category” => $category !== “all” ? $category : “”,
“paged” => $i
]));

$current_class = ($i === $paged) ? “page-numbers current” : “page-numbers”;

echo ‘‘;
}

echo ‘

‘;
}

else :
echo <<

No Products Found

We’re currently updating our product catalog. Please check back soon.



Back to Home

HTML;
endif;

wp_reset_postdata();

$html = ob_get_clean();
hx_response($html);
}
?>

“product”,
“posts_per_page” => 12,
“orderby” => “date”,
“order” => “DESC”
);
$products_query = new WP_Query($args);

if ($products_query->have_posts()) :
while ($products_query->have_posts()) : $products_query->the_post();
$product_cats = get_the_terms(get_the_ID(), “product_cat”);
$cat_slugs = array();
if ($product_cats && !is_wp_error($product_cats)) {
foreach ($product_cats as $cat) {
$cat_slugs[] = $cat->slug;
}
}
$cat_classes = !empty($cat_slugs) ? “product-item ” . implode(” “, array_map(“esc_attr”, $cat_slugs)) : “product-item”;
?>

” class=”block”>

“lazy”,
“decoding” => “async”,
“alt” => esc_attr($alt),
“class” => “w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-500”,
“sizes” => “(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw”
));
} elseif (is_array($acf_image) && !empty($acf_image[“url”])) {
$alt = $acf_image[“alt”] ?? get_the_title();
echo ‘' . esc_attr($alt) . '‘;
} elseif (is_string($acf_image) && $acf_image) {
echo ‘' . esc_attr(get_the_title()) . '‘;
} else {
echo ‘' . esc_attr(get_the_title()) . '‘;
}
?>

name); ?>










View Details


max_num_pages > 1) : ?>

max_num_pages; $i++) {
$params = http_build_query(array_filter([
“block_id” => $block_id,
“paged” => $i
]));

$current_class = ($i === 1) ? “page-numbers current” : “page-numbers”;

echo ‘‘;
}
?>



“product_cat”,
“hide_empty” => true,
));
?>