add_action('wp_enqueue_scripts', 'enqueue_parent_styles'); function enqueue_parent_styles() { wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('hello-elementor'), wp_get_theme()->get('1.0.0') ); } function shyre_spec_table() { $group = get_field('equipment_specifications', get_the_ID()); //prevents a null array error in the elementor editor. if (!$group) { return false; } if ($group['show_equipment_specifications']) { echo '

Equipment Specifications

'; $rows = $group['equipment_specifications_table']; if ($rows) { echo ''; foreach ($rows as $row) { $spec = $row['spec']; $details = $row['details']; echo ''; echo ''; echo ''; echo ''; } echo '
' . $spec . '' . $details . '
'; } echo '
'; } } function shyre_cleaning_table() { $group = get_field('cleaning_process', get_the_ID()); //prevents a null array error in the elementor editor. if (!$group) { return false; } if ($group['show_cleaning_process']) { echo '

Cleaning

'; $rows = $group['cleaning_process_table']; $title = $group["cleaning_process_title"]; if ($rows) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach ($rows as $row) { $stage = $row['stage']; $function = $row['function']; $description = $row['description']; $enhancement = $row['enhancement']; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
' . $title . '
StageFunctionEnhancements
' . $stage . '' . $function . '' . $description . '' . $enhancement . '
'; } echo '
'; } } function shyre_category_grid($atts = [], $content = null, $tag = '') { $atts = array_change_key_case((array)$atts, CASE_LOWER); //override & defaults $shyre_atts = shortcode_atts( array( 'parent' => 'ranges', ), $atts, $tag ); $parent = get_categories([ 'taxonomy' => 'product-category', 'hide_empty' => false, 'slug' => $shyre_atts['parent'], ]); if ($parent) { $categories = get_categories([ 'taxonomy' => 'product-category', 'hide_empty' => false, 'parent' => $parent[0]->term_id, ]); echo '
'; foreach ($categories as $c) { //var_dump($c); $name = $c->cat_name; $desc = substr($c->category_description, 0, 80) . "..."; $slug = $c->slug; $icon = get_field('icon', "product-category_" . $c->term_id); $iconSrc = '/wp-content/uploads/2023/04/Ellipse-1.png'; $iconAlt = ''; if ($icon) { $iconSrc = esc_url($icon['url']); $iconAlt = esc_url($icon['alt']); } echo " $iconAlt

$name

Learn More

"; } echo '
'; } else { return false; } } function shyre_custom_accordion() { $fileName = "wp-content/themes/Shyre-child/custom_accordion.html"; if (file_exists($fileName) && ($fp = fopen($fileName, "r")) !== false) { echo stream_get_contents($fp); fclose($fp); } } function shyre_triforce() { echo "

Machine

Process

Chemistry

"; } function register_shortcodes() { add_shortcode('shyre-spec-table', 'shyre_spec_table'); add_shortcode('shyre-cleaning-table', 'shyre_cleaning_table'); add_shortcode('shyre-category-grid', 'shyre_category_grid'); add_shortcode('shyre-custom-accordion', 'shyre_custom_accordion'); add_shortcode('shyre-triforce', 'shyre_triforce'); } add_action('init', 'register_shortcodes');