custom-add-to-cart-or-resume

function ld_course_resume_or_buy_shortcode( $atts ) { $atts = shortcode_atts( [ ‘course_id’ => get_the_ID(), // use current course if none passed ‘resume_label’ => ‘Resume Course’, ‘buy_label’ => ‘Buy Now’, ], $atts ); $course_id = intval( $atts[‘course_id’] ); $user_id = get_current_user_id(); // Check…Continue reading

1. Theme Setup & Styles

/** * Lädt Parent Stylesheet, Child Stylesheet (optional, aber empfohlen), * Owl Carousel Styles und Owl Carousel Skript. */ add_action( ‘wp_enqueue_scripts’, ‘mein_child_theme_enqueue_styles_and_scripts’, 20 ); // Funktionsname angepasst, Priorität 20 function mein_child_theme_enqueue_styles_and_scripts() { // Lade Parent Theme Stylesheet wp_enqueue_style( ‘parent-style’, get_template_directory_uri()…Continue reading

46. After Header – Elementor Shortcode

/** * Zeigt das Elementor Template nach dem Header an. * Hängt sich an ‘mein_child_theme_after_header’ in header.php. */ add_action(‘mein_child_theme_after_header’, ‘mein_child_theme_display_after_header_content’); function mein_child_theme_display_after_header_content() { // Stelle sicher, dass die Shortcode-Funktion existiert if (function_exists(‘do_shortcode’)) { $template_id = ‘43487’; // Elementor Template ID…Continue reading

45. Header – Custom Icons (Search + Cart)

/** * Zeigt die benutzerdefinierten Header Icons (Suche und Warenkorb) an. * Hängt sich an ‘mein_child_theme_header_icons’ in header.php. */ add_action(‘mein_child_theme_header_icons’, ‘mein_child_theme_display_header_icons’); function mein_child_theme_display_header_icons() { // Prüfe ob WooCommerce und die Warenkorb-Funktion existieren $cart_count = 0; if ( class_exists(‘WooCommerce’) && function_exists(‘WC’)…Continue reading

44. Header – Topbar Shortcode

/** * Zeigt die Topbar via Elementor Shortcode an. * Hängt sich an ‘mein_child_theme_topbar’ in header.php. */ add_action(‘mein_child_theme_topbar’, ‘mein_child_theme_display_topbar’); function mein_child_theme_display_topbar() { // Stelle sicher, dass die Shortcode-Funktion existiert if (function_exists(‘do_shortcode’)) { $template_id = ‘28958’; // Elementor Template ID ?>Continue reading

43. Header – ACF Action Bar

/** * Zeigt die ACF-basierte Action Bar im Header an. * Hängt sich an ‘mein_child_theme_action_header’ in header.php. */ add_action(‘mein_child_theme_action_header’, ‘mein_child_theme_display_action_header’); function mein_child_theme_display_action_header() { // Prüfe ob ACF aktiv ist if (!function_exists(‘get_field’)) return; $actionText = get_field(‘text_actiebalk_header’, ‘option’); $visibility = get_field(‘action_header_visibility’, ‘option’);…Continue reading

42. Head Assets – Late (eTrusted)

/** * Fügt den eTrusted Script Tag spät im Bereich hinzu. * Hängt sich an ‘mein_child_theme_late_head_assets’ in header.php (nach wp_head()). */ add_action(‘mein_child_theme_late_head_assets’, ‘mein_child_theme_add_etrusted_script’, 5); function mein_child_theme_add_etrusted_script() { ?>Continue reading

41. Head Assets – Preload, Fonts, Inline Style, FontAwesome

/** * Fügt benutzerdefinierte Preload-Links, Font-Links, Inline-Styles * und FontAwesome-Links in den Bereich ein. * Hängt sich an ‘mein_child_theme_head_assets’ in header.php (vor wp_head()). */ add_action(‘mein_child_theme_head_assets’, ‘mein_child_theme_add_head_assets_early’, 5); function mein_child_theme_add_head_assets_early() { ?>Continue reading

40. Footer JS – Block 3 (jQuery UI & Accordion/Owl Init)

/** * Fügt hardcodierte jQuery UI CSS/JS Links und den dritten Block JavaScript hinzu. * WARNUNG: Das Laden von Skripten/Styles auf diese Weise ist NICHT empfohlen! * Es umgeht WordPress-Enqueueing, Abhängigkeitsmanagement und Optimierungen. */ add_action(‘wp_footer’, ‘mein_child_theme_footer_js_block_3’, 22); // Priorität 22…Continue reading

39. Footer JS – Block 2 (Owl Carousel Initializations)

/** * Fügt den zweiten Block JavaScript (Owl Carousel Initialisierungen) in den Footer ein. * Setzt voraus, dass die Owl Carousel Bibliothek geladen wurde. */ add_action(‘wp_footer’, ‘mein_child_theme_footer_js_block_2’, 21); // Priorität 21 (nach Block 1) function mein_child_theme_footer_js_block_2() { // Nur im…Continue reading