HUSKY - Products Filter Professional for WooCommerce

woof-template-part

woof_template_part

[woof_products] kısa kodunda ürünleri görüntülemek için kullanılan şablon bölümünün adını değiştirmenizi sağlar.

Parametreler

$template (string) — şablon adı ('product' varsayılan)

Kaynak Dosya

index.php

Kod Örneği

add_filter('woof_template_part', function($template) {
    // Use a custom template for products display
    // Place your template at: wp-content/themes/your-theme/woof/product-custom.php
    $custom_template = 'product-custom';
    if (is_product_category('specials')) {
        return $custom_template;
    }
    return $template;
});

Kullanım Notları

  • Bu kodu temanızın functions.php dosyasına veya özel bir eklentiye ekleyin.
  • Kanca, filtreleme işlemi sırasında uygulanır — değişiklikler anında yürürlüğe girer.
  • Geri arama fonksiyonundan her zaman beklenen değer türünü döndürün.