/** * Fügt einen DIV-Wrapper mit der Spectrum-Klasse um Produkte im Loop hinzu. */ add_action( ‘woocommerce_before_shop_loop_item’, ‘add_product_cat’, 2); function add_product_cat() { global $product; // Prüfen ob $product ein WC_Product Objekt ist if ( ! $product instanceof WC_Product ) return; //…Continue reading
/** * Registriert die benutzerdefinierte Taxonomie ‘spectrum’ für Produkte. */ add_action( ‘init’, ‘custom_taxonomy_spectrum’, 0 ); // Priorität 0 für frühe Registrierung function custom_taxonomy_spectrum() { // Prüfen ob Taxonomie bereits existiert if ( taxonomy_exists(‘spectrum’) ) return; $labels = array( ‘name’ =>…Continue reading
/** * Shortcode [category-faq-block] für FAQ-Bereich auf Kategorieseiten (ACF basiert). */ function category_faq_section(){ // Prüfen ob ACF aktiv ist und wir uns nicht im Admin befinden if ( !function_exists(‘have_rows’) || is_admin() ) return; $term = get_queried_object(); // Nur ausführen, wenn…Continue reading
/** * Fügt JS hinzu, um die ausgewählte Variations-ID in ein Feld zu schreiben. * Nutzt wc_enqueue_js, was zu Problemen mit Minifyern führen kann. */ add_action( ‘woocommerce_before_add_to_cart_quantity’, ‘bbloomer_display_dropdown_variation_add_cart’ ); function bbloomer_display_dropdown_variation_add_cart() { global $product; // Prüfen ob $product ein WC_Product…Continue reading
/** * Fügt Preis und Text vor dem Add-to-Cart-Button hinzu. */ add_action( ‘woocommerce_before_add_to_cart_button’, ‘mish_before_add_to_cart_btn’ ); function mish_before_add_to_cart_btn(){ global $product; // Prüfen ob $product ein WC_Product Objekt ist if ( ! $product instanceof WC_Product ) return; if( $product->is_type(‘simple’) ) { echo…Continue reading
/** * Shortcode [cbd_oil_percent_dropdown] für CBD Öl Prozent Dropdown (ACF basiert). */ function cbd_oil_percent(){ // Prüfen ob ACF aktiv ist und wir uns nicht im Admin befinden if ( !function_exists(‘have_rows’) || is_admin() ) return; $term = get_queried_object(); // Nur ausführen,…Continue reading
/** * Best Selling Products Shotcode [best_selling_products_slider] */ function best_selling_product_shortcodes(){ ob_start(); // Prüfen ob ACF aktiv ist if( function_exists(‘get_field’) ) { $featured_posts = get_field(‘choose_best_selling_products’, ‘option’); // Prüfen ob Posts ausgewählt wurden if( $featured_posts ) { $query_args = array( ‘post_type’ =>…Continue reading
/** * Shortcode [cat_sepc_filter_everything_plugin] für Filter Everything Plugin basierend auf Kategorie. */ function cat_sepc_filter_everything_plugin_function(){ ob_start(); $current_category = get_queried_object(); // Prüfen ob $current_category ein Objekt ist und term_id hat if ( is_object($current_category) && isset($current_category->term_id) ) { if ($current_category->term_id == 268) {…Continue reading
/** * Header Top Bar slider Shortcode [header_top_bar_slider] */ function header_top_bar_slider_shortcodes(){ ob_start();?> Kundenservice: +49 32 214219848 30 Tage Geld-zurück-Garantie Kostenlose Lieferung in 1-2 ArbeitstageContinue reading
/** * Blog Slider Shortcode [blog_shortcodes] */ function blog_shortcodes(){ ob_start(); $query = new WP_Query( array( ‘post_type’ => ‘post’ , ‘posts_per_page’ => ’20’) ); $i=1; if ( $query->have_posts() ) : ?>Continue reading