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 = ‘‘;
} elseif (is_string($acf_image) && $acf_image) {
$image_html = ‘‘;
} else {
$image_html = ‘‘;
}
$cat_badge = “”;
if ($product_cats && !is_wp_error($product_cats)) {
$cat_badge = ‘
‘;
}
$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 .= ‘
‘;
}
}
{$cat_badge}
{esc_html(get_the_title())}
{$excerpt_html}
{$features_html}
{esc_html(get_the_date())}
View Details