Changeset 305343
- Timestamp:
- 12/23/2025 11:14:16 AM (11 months ago)
- Location:
- modern-dental-clinic/1.3
- Files:
-
- 11 edited
- 1 copied
-
. (copied) (copied from modern-dental-clinic/1.2 )
-
assets/css/main.css (modified) (1 diff)
-
functions.php (modified) (10 diffs)
-
readme.txt (modified) (1 diff)
-
style.css (modified) (2 diffs)
-
template-parts/features.php (modified) (1 diff)
-
template-parts/hero.php (modified) (4 diffs)
-
template-parts/hours.php (modified) (4 diffs)
-
template-parts/pricing.php (modified) (1 diff)
-
template-parts/services.php (modified) (3 diffs)
-
template-parts/team.php (modified) (2 diffs)
-
template-parts/testimonials.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modern-dental-clinic/1.3/assets/css/main.css
r302518 r305343 1246 1246 } 1247 1247 1248 /* Fix long post titles overflow on archive pages */ 1249 .single .entry-title, .archive .entry-title, 1250 .blog .entry-title, 1251 .search .entry-title { 1252 white-space: normal; 1253 word-break: break-word; 1254 overflow-wrap: anywhere; 1255 max-width: 100%; 1256 } 1257 1258 1248 1259 .entry-meta { 1249 1260 font-size: 14px; -
modern-dental-clinic/1.3/functions.php
r304257 r305343 283 283 $hero_defaults = array( 284 284 array( 285 'title' => __('Welcome to Our Dental Clinic', 'modern-dental-clinic'),286 'subtitle' => __('Your trusted partner for exceptional dental care', 'modern-dental-clinic'),285 'title' => '', 286 'subtitle' => '', 287 287 'image' => '', 288 'cta_text' => __('Book Your Appointment', 'modern-dental-clinic'), 289 ), 290 array( 291 'title' => __('Advanced Dental Solutions', 'modern-dental-clinic'), 292 'subtitle' => __('Experience modern dentistry with cutting-edge technology', 'modern-dental-clinic'), 293 'image' => '', 294 'cta_text' => __('Schedule Now', 'modern-dental-clinic'), 295 ), 296 array( 297 'title' => __('Your Smile is Our Priority', 'modern-dental-clinic'), 298 'subtitle' => __('Expert care from compassionate professionals', 'modern-dental-clinic'), 299 'image' => '', 300 'cta_text' => __('Get Started', 'modern-dental-clinic'), 288 'cta_text' => '', 301 289 ), 302 290 ); … … 340 328 'default' => json_encode(array( 341 329 array( 342 'title' => __('Expert Dentists', 'modern-dental-clinic'), 343 'content' => __('Our experienced team provides best-in-class dental care.', 'modern-dental-clinic') 344 ), 345 array( 346 'title' => __('Modern Technology', 'modern-dental-clinic'), 347 'content' => __('State-of-the-art equipment ensures accurate diagnostics.', 'modern-dental-clinic') 348 ), 349 array( 350 'title' => __('Patient Comfort', 'modern-dental-clinic'), 351 'content' => __('We create a relaxing environment to ease dental anxiety.', 'modern-dental-clinic') 330 'title' => '', 331 'content' => '', 352 332 ), 353 333 )), … … 385 365 'default' => json_encode(array( 386 366 array( 387 'title' => __('General Checkup', 'modern-dental-clinic'), 388 'content' => __('Comprehensive dental examination and preventive care.', 'modern-dental-clinic'), 389 ), 390 array( 391 'title' => __('Teeth Cleaning', 'modern-dental-clinic'), 392 'content' => __('Professional cleaning to remove plaque and tartar.', 'modern-dental-clinic'), 393 ), 394 array( 395 'title' => __('Teeth Whitening', 'modern-dental-clinic'), 396 'content' => __('Professional whitening treatments.', 'modern-dental-clinic'), 367 'title' => '', 368 'content' => '', 397 369 ), 398 370 )), … … 428 400 $team_defaults = array( 429 401 array( 430 'name' => __( 'Team Member Name', 'modern-dental-clinic' ), 431 'role' => __( 'Designation', 'modern-dental-clinic' ), 432 'bio' => __( 'Short description about the team member.', 'modern-dental-clinic' ), 433 'image' => function_exists( 'get_stylesheet_directory_uri' ) 434 ? get_stylesheet_directory_uri() . '/assets/images/team-1.svg' 435 : '', 402 'name' => '', 403 'role' => '', 404 'bio' => '', 405 'image' => '', 436 406 'socials' => array( 437 407 'facebook' => '', … … 440 410 ), 441 411 ), 442 array(443 'name' => __( 'Team Member Name', 'modern-dental-clinic' ),444 'role' => __( 'Designation', 'modern-dental-clinic' ),445 'bio' => __( 'Short description about the team member.', 'modern-dental-clinic' ),446 'image' => function_exists( 'get_stylesheet_directory_uri' )447 ? get_stylesheet_directory_uri() . '/assets/images/team-2.svg'448 : '',449 'socials' => array(450 'facebook' => '',451 'twitter' => '',452 'linkedin' => '',453 ),454 ),455 array(456 'name' => __( 'Team Member Name', 'modern-dental-clinic' ),457 'role' => __( 'Designation', 'modern-dental-clinic' ),458 'bio' => __( 'Short description about the team member.', 'modern-dental-clinic' ),459 'image' => function_exists( 'get_stylesheet_directory_uri' )460 ? get_stylesheet_directory_uri() . '/assets/images/team-3.svg'461 : '',462 'socials' => array(463 'facebook' => '',464 'instagram' => '',465 'twitter' => '',466 'youtube' => '',467 ),468 ),469 412 ); 470 413 … … 502 445 'default' => json_encode(array( 503 446 array( 504 'content' => __('Excellent dental care! Dr. Smith was very professional and friendly.', 'modern-dental-clinic'), 505 'author' => __('Sarah M.', 'modern-dental-clinic') 506 ), 507 array( 508 'content' => __('Amazing experience from start to finish. The staff is welcoming and the facilities are very clean.', 'modern-dental-clinic'), 509 'author' => __('John P.', 'modern-dental-clinic') 510 ), 511 array( 512 'content' => __('My teeth have never looked better! The teeth whitening treatment was fantastic and painless.', 'modern-dental-clinic'), 513 'author' => __('Maria R.', 'modern-dental-clinic') 447 'content' => '', 448 'author' => '', 514 449 ), 515 450 )), … … 557 492 'default' => json_encode(array( 558 493 array( 559 'name' => __('Basic', 'modern-dental-clinic'),560 'price' => __('Free', 'modern-dental-clinic'),561 'period' => __('Always', 'modern-dental-clinic'),562 'description' => __('Essential dental care', 'modern-dental-clinic'),563 'features' => __('Initial consultation,Basic examination,Oral health tips', 'modern-dental-clinic'),564 'cta_text' => __('Get Started', 'modern-dental-clinic'),494 'name' => '', 495 'price' => '', 496 'period' => '', 497 'description' => '', 498 'features' => '', 499 'cta_text' => '', 565 500 'popular' => false, 566 ),567 array(568 'name' => __('Standard', 'modern-dental-clinic'),569 'price' => __('$199', 'modern-dental-clinic'),570 'period' => __('Per Visit', 'modern-dental-clinic'),571 'description' => __('Comprehensive care', 'modern-dental-clinic'),572 'features' => __('Everything in Basic,Professional cleaning,X-rays and diagnosis', 'modern-dental-clinic'),573 'cta_text' => __('Choose Plan', 'modern-dental-clinic'),574 'popular' => false,575 ),576 array(577 'name' => __('Premium', 'modern-dental-clinic'),578 'price' => __('$499', 'modern-dental-clinic'),579 'period' => __('Per Visit', 'modern-dental-clinic'),580 'description' => __('Advanced treatments', 'modern-dental-clinic'),581 'features' => __('Everything in Standard,Cosmetic services,Advanced procedures,Priority scheduling', 'modern-dental-clinic'),582 'cta_text' => __('Choose Plan', 'modern-dental-clinic'),583 'popular' => true,584 501 ), 585 502 )), … … 664 581 $office_hours_defaults = array( 665 582 array( 666 'day' => __( 'Monday - Friday', 'modern-dental-clinic' ), 667 'hours' => __( '9:00 AM - 6:00 PM', 'modern-dental-clinic' ), 668 ), 669 array( 670 'day' => __( 'Saturday', 'modern-dental-clinic' ), 671 'hours' => __( '10:00 AM - 4:00 PM', 'modern-dental-clinic' ), 672 ), 673 array( 674 'day' => __( 'Sunday', 'modern-dental-clinic' ), 675 'hours' => __( 'Closed', 'modern-dental-clinic' ), 583 'day' => '', 584 'hours' => '', 676 585 ), 677 586 ); … … 730 639 } 731 640 add_action( 'init', 'mdc_register_block_patterns' ); 732 733 /**734 * Populate theme_mods with sensible defaults on theme activation735 * so the Customizer UI is pre-filled for the site admin with all sections.736 */737 if (!function_exists('mdc_set_theme_defaults')) {738 function mdc_set_theme_defaults() {739 // Clinic info defaults740 $clinic_name = get_bloginfo('name');741 $admin_email = get_option('admin_email');742 $theme_uri = get_template_directory_uri();743 744 // Build all defaults matching Customizer register function745 $defaults = array(746 // Clinic Information (do not prefill clinic name on activation)747 'mdc_clinic_name' => __( 'Modern Dental Clinic', 'modern-dental-clinic' ),748 'mdc_clinic_phone' => __( '555-123-4567', 'modern-dental-clinic' ),749 'mdc_clinic_email' => __( 'example@example.com', 'modern-dental-clinic' ),750 'mdc_clinic_address' => __( '123 Main Street, Your City, State 12345', 'modern-dental-clinic' ),751 'mdc_clinic_description' => sprintf(752 /* translators: %s is the site name */753 __( 'Welcome to %s. We provide comprehensive dental care for your entire family.', 'modern-dental-clinic' ),754 $clinic_name755 ),756 757 // Colors & Branding758 'mdc_accent_color' => '#0b76d1',759 'mdc_secondary_color' => '#e6f2ff',760 'mdc_text_color' => '#222222',761 'mdc_background_color' => '#ffffff',762 763 // Social Media (default placeholder URLs)764 'mdc_social_facebook' => 'https://example.com/facebook',765 'mdc_social_twitter' => 'https://example.com/twitter',766 'mdc_social_instagram' => 'https://example.com/instagram',767 'mdc_social_youtube' => 'https://example.com/youtube',768 'mdc_social_linkedin' => 'https://example.com/linkedin',769 770 // Hero Section (Slider)771 'mdc_hero_slides' => json_encode(array(772 array(773 'title' => __( 'Welcome to Our Dental Clinic', 'modern-dental-clinic' ),774 'subtitle' => __( 'Your trusted partner for exceptional dental care', 'modern-dental-clinic' ),775 'image' => $theme_uri . '/assets/images/hero-1.svg',776 'cta_text' => __( 'Book Your Appointment', 'modern-dental-clinic' ),777 ),778 array(779 'title' => __( 'Advanced Dental Solutions', 'modern-dental-clinic' ),780 'subtitle' => __( 'Experience modern dentistry with cutting-edge technology', 'modern-dental-clinic' ),781 'image' => $theme_uri . '/assets/images/hero-2.svg',782 'cta_text' => __( 'Schedule Now', 'modern-dental-clinic' ),783 ),784 array(785 'title' => __( 'Your Smile is Our Priority', 'modern-dental-clinic' ),786 'subtitle' => __( 'Expert care from compassionate professionals', 'modern-dental-clinic' ),787 'image' => $theme_uri . '/assets/images/hero-3.svg',788 'cta_text' => __( 'Get Started', 'modern-dental-clinic' ),789 ),790 )),791 'mdc_hero_autoplay' => 1,792 793 // Features Section794 'mdc_features_section_title' => __( 'Why Choose Us', 'modern-dental-clinic' ),795 'mdc_features_items' => json_encode(array(796 array(797 'title' => __( 'Expert Dentists', 'modern-dental-clinic' ),798 'content' => __( 'Our experienced team provides best-in-class dental care.', 'modern-dental-clinic' ),799 ),800 array(801 'title' => __( 'Modern Technology', 'modern-dental-clinic' ),802 'content' => __( 'State-of-the-art equipment ensures accurate diagnostics.', 'modern-dental-clinic' ),803 ),804 array(805 'title' => __( 'Patient Comfort', 'modern-dental-clinic' ),806 'content' => __( 'We create a relaxing environment to ease dental anxiety.', 'modern-dental-clinic' ),807 ),808 array(809 'title' => __( '24/7 Emergency Care', 'modern-dental-clinic' ),810 'content' => __( 'Our dedicated emergency team is available around the clock to handle urgent dental issues.', 'modern-dental-clinic' ),811 ),812 array(813 'title' => __( 'Affordable Treatments', 'modern-dental-clinic' ),814 'content' => __( 'We offer transparent pricing and flexible payment options to make quality dental care accessible to everyone.', 'modern-dental-clinic' ),815 ),816 array(817 'title' => __( 'Personalized Treatment Plans', 'modern-dental-clinic' ),818 'content' => __( 'Every patient receives a customized care plan tailored to their oral health needs and goals.', 'modern-dental-clinic' ),819 ),820 )),821 822 // Services Section823 'mdc_services_section_title' => __( 'Our Dental Services', 'modern-dental-clinic' ),824 'mdc_services_items' => json_encode(array(825 array(826 'title' => __( 'General Checkup', 'modern-dental-clinic' ),827 'content' => __( 'Comprehensive dental examination and preventive care.', 'modern-dental-clinic' ),828 ),829 array(830 'title' => __( 'Teeth Cleaning', 'modern-dental-clinic' ),831 'content' => __( 'Professional cleaning to remove plaque and tartar.', 'modern-dental-clinic' ),832 ),833 array(834 'title' => __( 'Teeth Whitening', 'modern-dental-clinic' ),835 'content' => __( 'Professional whitening treatments.', 'modern-dental-clinic' ),836 ),837 array(838 'title' => __( 'Root Canal Therapy', 'modern-dental-clinic' ),839 'content' => __( 'Advanced root canal procedures to treat infected teeth and relieve pain while preserving the natural tooth.', 'modern-dental-clinic' ),840 ),841 array(842 'title' => __( 'Dental Implants', 'modern-dental-clinic' ),843 'content' => __( 'Permanent and natural-looking tooth replacement solutions to restore your smile and confidence.', 'modern-dental-clinic' ),844 ),845 array(846 'title' => __( 'Orthodontic Care', 'modern-dental-clinic' ),847 'content' => __( 'Braces and clear aligner treatments designed to straighten teeth and improve bite alignment.', 'modern-dental-clinic' ),848 ),849 )),850 'mdc_show_services' => 1,851 852 // Team Section853 'mdc_team_section_title' => __( 'Meet Our Dental Team', 'modern-dental-clinic' ),854 'mdc_team_items' => json_encode(array(855 array(856 'name' => __( 'Dr. Smith', 'modern-dental-clinic' ),857 'role' => __( 'BDS, General Dentist', 'modern-dental-clinic' ),858 'bio' => __( '15+ years of experience in general dentistry.', 'modern-dental-clinic' ),859 'image' => $theme_uri . '/assets/images/team-1.svg',860 'socials' => array(861 'facebook' => '',862 'instagram' => '',863 'linkedin' => '',864 'twitter' => '',865 'youtube' => '',866 ),867 ),868 array(869 'name' => __( 'Dr. Johnson', 'modern-dental-clinic' ),870 'role' => __( 'MDS, Orthodontist', 'modern-dental-clinic' ),871 'bio' => __( 'Specializing in cosmetic and corrective orthodontics.', 'modern-dental-clinic' ),872 'image' => $theme_uri . '/assets/images/team-2.svg',873 'socials' => array(874 'facebook' => '',875 'instagram' => '',876 'linkedin' => '',877 'twitter' => '',878 'youtube' => '',879 ),880 ),881 array(882 'name' => __( 'Dr. Williams', 'modern-dental-clinic' ),883 'role' => __( 'BDS, Dental Hygienist', 'modern-dental-clinic' ),884 'bio' => __( 'Dedicated to preventive care and patient education.', 'modern-dental-clinic' ),885 'image' => $theme_uri . '/assets/images/team-3.svg',886 'socials' => array(887 'facebook' => '',888 'instagram' => '',889 'linkedin' => '',890 'twitter' => '',891 'youtube' => '',892 ),893 ),894 array(895 'name' => __( 'Dr. Brown', 'modern-dental-clinic' ),896 'role' => __( 'MDS, Endodontist', 'modern-dental-clinic' ),897 'bio' => __( 'Expert in painless root canal treatments and restorative procedures.', 'modern-dental-clinic' ),898 'image' => $theme_uri . '/assets/images/team-1.svg',899 'socials' => array(900 'facebook' => '',901 'instagram' => '',902 'linkedin' => '',903 'twitter' => '',904 'youtube' => '',905 ),906 ),907 array(908 'name' => __( 'Dr. Taylor', 'modern-dental-clinic' ),909 'role' => __( 'BDS, Pediatric Dentist', 'modern-dental-clinic' ),910 'bio' => __( 'Specialized in gentle dental care for children of all ages.', 'modern-dental-clinic' ),911 'image' => $theme_uri . '/assets/images/team-2.svg',912 'socials' => array(913 'facebook' => '',914 'instagram' => '',915 'linkedin' => '',916 'twitter' => '',917 'youtube' => '',918 ),919 ),920 array(921 'name' => __( 'Dr. Anderson', 'modern-dental-clinic' ),922 'role' => __( 'MDS, Oral Surgeon', 'modern-dental-clinic' ),923 'bio' => __( 'Highly skilled in surgical procedures including extractions and implants.', 'modern-dental-clinic' ),924 'image' => $theme_uri . '/assets/images/team-3.svg',925 'socials' => array(926 'facebook' => '',927 'instagram' => '',928 'linkedin' => '',929 'twitter' => '',930 'youtube' => '',931 ),932 ),933 )),934 'mdc_show_team' => 1,935 936 // Testimonials Section937 'mdc_testimonials_section_title' => __( 'What Our Patients Say', 'modern-dental-clinic' ),938 'mdc_testimonials_items' => json_encode(array(939 array(940 'content' => __( 'Excellent dental care! Dr. Smith was very professional and friendly.', 'modern-dental-clinic' ),941 'author' => __( 'Sarah M.', 'modern-dental-clinic' ),942 ),943 array(944 'content' => __( 'Amazing experience from start to finish. The staff is welcoming and the facilities are very clean.', 'modern-dental-clinic' ),945 'author' => __( 'John P.', 'modern-dental-clinic' ),946 ),947 array(948 'content' => __( 'My teeth have never looked better! The teeth whitening treatment was fantastic and painless.', 'modern-dental-clinic' ),949 'author' => __( 'Maria R.', 'modern-dental-clinic' ),950 ),951 array(952 'content' => __( 'I was nervous about my procedure, but the team made me feel completely at ease. Highly recommended!', 'modern-dental-clinic' ),953 'author' => __( 'Daniel K.', 'modern-dental-clinic' ),954 ),955 array(956 'content' => __( 'Great service and modern equipment. They explained everything clearly and made the process smooth.', 'modern-dental-clinic' ),957 'author' => __( 'Priya S.', 'modern-dental-clinic' ),958 ),959 array(960 'content' => __( 'The best dental clinic I’ve ever visited! Friendly staff, quick service, and excellent results.', 'modern-dental-clinic' ),961 'author' => __( 'Emily T.', 'modern-dental-clinic' ),962 ),963 )),964 'mdc_show_testimonials' => 1,965 966 // Pricing Section967 'mdc_pricing_section_title' => __( 'Our Pricing Plans', 'modern-dental-clinic' ),968 'mdc_pricing_section_subtitle' => __( 'Affordable dental care for the whole family', 'modern-dental-clinic' ),969 'mdc_pricing_items' => json_encode(array(970 array(971 'name' => __( 'Basic', 'modern-dental-clinic' ),972 'price' => __( 'Free', 'modern-dental-clinic' ),973 'period' => __( 'Always', 'modern-dental-clinic' ),974 'description' => __( 'Essential dental care', 'modern-dental-clinic' ),975 'features' => __( 'Initial consultation,Basic examination,Oral health tips', 'modern-dental-clinic' ),976 'cta_text' => __( 'Get Started', 'modern-dental-clinic' ),977 'popular' => false,978 ),979 array(980 'name' => __( 'Standard', 'modern-dental-clinic' ),981 'price' => __( '$199', 'modern-dental-clinic' ),982 'period' => __( 'Per Visit', 'modern-dental-clinic' ),983 'description' => __( 'Comprehensive care', 'modern-dental-clinic' ),984 'features' => __( 'Everything in Basic,Professional cleaning,X-rays and diagnosis', 'modern-dental-clinic' ),985 'cta_text' => __( 'Choose Plan', 'modern-dental-clinic' ),986 'popular' => true,987 ),988 array(989 'name' => __( 'Premium', 'modern-dental-clinic' ),990 'price' => __( '$499', 'modern-dental-clinic' ),991 'period' => __( 'Per Visit', 'modern-dental-clinic' ),992 'description' => __( 'Advanced treatments', 'modern-dental-clinic' ),993 'features' => __( 'Everything in Standard,Cosmetic services,Advanced procedures,Priority scheduling', 'modern-dental-clinic' ),994 'cta_text' => __( 'Choose Plan', 'modern-dental-clinic' ),995 'popular' => false,996 ),997 )),998 'mdc_show_pricing' => 1,999 1000 // Hours Section1001 'mdc_hours_section_title' => __( 'Clinic Hours & Location', 'modern-dental-clinic' ),1002 'mdc_office_hours' => json_encode(array(1003 array(1004 'day' => __( 'Monday - Friday', 'modern-dental-clinic' ),1005 'hours' => __( '9:00 AM - 6:00 PM', 'modern-dental-clinic' ),1006 ),1007 array(1008 'day' => __( 'Saturday', 'modern-dental-clinic' ),1009 'hours' => __( '10:00 AM - 4:00 PM', 'modern-dental-clinic' ),1010 ),1011 array(1012 'day' => __( 'Sunday', 'modern-dental-clinic' ),1013 'hours' => __( 'Closed', 'modern-dental-clinic' ),1014 ),1015 )),1016 'mdc_show_hours' => 1,1017 );1018 1019 foreach ($defaults as $key => $val) {1020 // Only set if theme_mod isn't already set1021 $current = get_theme_mod($key, null);1022 if ($current === null || $current === '') {1023 set_theme_mod($key, $val);1024 }1025 }1026 1027 // Create a 'Landing menu' with anchor links and assign to the 'primary' location1028 if (function_exists('wp_get_nav_menu_object')) {1029 $menu_name = 'Landing menu';1030 $menu_obj = wp_get_nav_menu_object($menu_name);1031 if (!$menu_obj) {1032 $menu_id = wp_create_nav_menu(sanitize_text_field($menu_name));1033 if (!is_wp_error($menu_id)) {1034 $links = array(1035 array('title' => __('Features', 'modern-dental-clinic'), 'url' => '#features'),1036 array('title' => __('Services', 'modern-dental-clinic'), 'url' => '#services'),1037 array('title' => __('Team', 'modern-dental-clinic'), 'url' => '#team'),1038 array('title' => __('Testimonials', 'modern-dental-clinic'), 'url' => '#testimonials'),1039 array('title' => __('Pricing', 'modern-dental-clinic'), 'url' => '#pricing'),1040 array('title' => __('Hours', 'modern-dental-clinic'), 'url' => '#hours'),1041 );1042 1043 foreach ($links as $item) {1044 wp_update_nav_menu_item($menu_id, 0, array(1045 'menu-item-title' => sanitize_text_field($item['title']),1046 'menu-item-url' => home_url($item['url']),1047 'menu-item-status' => 'publish',1048 ));1049 }1050 1051 // Assign to 'primary' location if it's not already assigned1052 if (function_exists('get_nav_menu_locations')) {1053 $locations = get_nav_menu_locations();1054 if (empty($locations['primary'])) {1055 $locations['primary'] = $menu_id;1056 set_theme_mod('nav_menu_locations', $locations);1057 }1058 } else {1059 $locations = get_theme_mod('nav_menu_locations', array());1060 if (empty($locations['primary'])) {1061 $locations['primary'] = $menu_id;1062 set_theme_mod('nav_menu_locations', $locations);1063 }1064 }1065 }1066 } else {1067 // If the menu exists but primary location is empty, assign it1068 if (function_exists('get_nav_menu_locations')) {1069 $locations = get_nav_menu_locations();1070 if (empty($locations['primary'])) {1071 $locations['primary'] = $menu_obj->term_id;1072 set_theme_mod('nav_menu_locations', $locations);1073 }1074 }1075 }1076 }1077 }1078 }1079 1080 add_action('after_switch_theme', 'mdc_set_theme_defaults');1081 641 1082 642 // ========== GET THEME OPTIONS ========== … … 1440 1000 } 1441 1001 } 1442 1443 // Remove emojis and wp-embed for a lightweight theme1444 remove_action('wp_head', 'print_emoji_detection_script', 7);1445 remove_action('wp_print_styles', 'print_emoji_styles');1446 add_action('wp_footer', function () { wp_dequeue_script('wp-embed'); }); -
modern-dental-clinic/1.3/readme.txt
r304257 r305343 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1. 27 Stable tag: 1.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
modern-dental-clinic/1.3/style.css
r304257 r305343 5 5 Author URI: https://www.iflair.com 6 6 Description: A fast, lightweight landing page theme with hero, features, testimonials, pricing and hours. 7 Version: 1. 27 Version: 1.3 8 8 Text Domain: modern-dental-clinic 9 9 License: GNU General Public License v2 or later … … 13 13 Tested up to: 6.9 14 14 Requires PHP: 7.4 15 Tags: one-column, two-columns, custom-background, custom-logo, flexible-header, accessibility-ready,block-styles15 Tags: one-column, two-columns, custom-background, custom-logo, flexible-header, block-styles 16 16 */ 17 17 -
modern-dental-clinic/1.3/template-parts/features.php
r302518 r305343 3 3 4 4 <?php 5 // Section title with fallback + translation support 6 $section_title = function_exists('mdc_get_option') 7 ? mdc_get_option('mdc_features_section_title', __('Why Choose Us', 'modern-dental-clinic')) 8 : __('Why Choose Us', 'modern-dental-clinic'); 5 // Section title (no default content) 6 $section_title = function_exists('mdc_get_option') 7 ? trim( mdc_get_option('mdc_features_section_title', '') ) 8 : ''; 9 ?> 9 10 10 // Retrieve features array 11 <?php if ( $section_title ) : ?> 12 <h2 class="mdc-section-title"> 13 <?php echo esc_html( $section_title ); ?> 14 </h2> 15 <?php endif; ?> 16 17 <div class="mdc-grid"> 18 19 <?php 11 20 $features = function_exists('mdc_get_features') 12 21 ? mdc_get_features() 13 22 : array(); 14 ?>15 23 16 <h2 class="mdc-section-title"><?php echo esc_html($section_title); ?></h2> 24 if ( ! empty( $features ) && is_array( $features ) ) : 25 foreach ( $features as $item ) : 17 26 18 <div class="mdc-grid"> 27 $title = ! empty( $item['title'] ) ? trim( $item['title'] ) : ''; 28 $content = ! empty( $item['content'] ) ? trim( $item['content'] ) : ''; 19 29 20 <?php if (!empty($features) && is_array($features)) : ?> 21 22 <?php foreach ($features as $item) : 23 24 $title = isset($item['title']) ? trim($item['title']) : ''; 25 $content = isset($item['content']) ? trim($item['content']) : ''; 26 27 // Skip empty entries 28 if ($title === '' && $content === '') { 30 if ( ! $title && ! $content ) { 29 31 continue; 30 32 } 31 ?>33 ?> 32 34 <div class="mdc-feature"> 33 <?php if ( $title) : ?>34 <h3><?php echo esc_html( $title); ?></h3>35 <?php if ( $title ) : ?> 36 <h3><?php echo esc_html( $title ); ?></h3> 35 37 <?php endif; ?> 36 38 37 <?php if ( $content) : ?>38 <p><?php echo esc_html( $content); ?></p>39 <?php if ( $content ) : ?> 40 <p><?php echo esc_html( $content ); ?></p> 39 41 <?php endif; ?> 40 42 </div> 41 <?php endforeach; ?> 43 <?php 44 endforeach; 42 45 43 <?php elseif (function_exists('have_rows') && have_rows('mdc_features')) : ?>46 elseif ( function_exists('have_rows') && have_rows('mdc_features') ) : 44 47 45 <?php 46 while (have_rows('mdc_features')) : 48 while ( have_rows('mdc_features') ) : 47 49 the_row(); 50 48 51 $title = get_sub_field('title') ?: ''; 49 52 $text = get_sub_field('text') ?: ''; 50 ?>51 <?php if ($title || $text) : ?>52 <div class="mdc-feature">53 <?php if ($title) : ?>54 <h3><?php echo esc_html($title); ?></h3>55 <?php endif; ?>56 53 57 <?php if ($text) : ?> 58 <p><?php echo esc_html($text); ?></p> 59 <?php endif; ?> 60 </div> 61 <?php endif; ?> 62 <?php endwhile; ?> 54 if ( ! $title && ! $text ) { 55 continue; 56 } 57 ?> 58 <div class="mdc-feature"> 59 <?php if ( $title ) : ?> 60 <h3><?php echo esc_html( $title ); ?></h3> 61 <?php endif; ?> 63 62 64 <?php else : ?> 65 66 <?php 67 // Fallback preset features (translation ready) 68 $default_features = array( 69 array( 70 'title' => __('Expert Dentists', 'modern-dental-clinic'), 71 'desc' => __('Our experienced team of qualified dentists provides best-in-class dental care.', 'modern-dental-clinic'), 72 ), 73 array( 74 'title' => __('Modern Technology', 'modern-dental-clinic'), 75 'desc' => __('State-of-the-art equipment ensures accurate diagnostics and painless treatments.', 'modern-dental-clinic'), 76 ), 77 array( 78 'title' => __('Patient Comfort', 'modern-dental-clinic'), 79 'desc' => __('We create a relaxing environment to ease dental anxiety and ensure comfort.', 'modern-dental-clinic'), 80 ), 81 ); 82 83 foreach ($default_features as $feature) : 84 ?> 85 <div class="mdc-feature"> 86 <h3><?php echo esc_html($feature['title']); ?></h3> 87 <p><?php echo esc_html($feature['desc']); ?></p> 63 <?php if ( $text ) : ?> 64 <p><?php echo esc_html( $text ); ?></p> 65 <?php endif; ?> 88 66 </div> 89 <?php endforeach; ?> 90 91 <?php endif; ?> 67 <?php 68 endwhile; 69 endif; 70 ?> 92 71 93 72 </div> -
modern-dental-clinic/1.3/template-parts/hero.php
r304257 r305343 3 3 4 4 <?php 5 // Retrieve hero slides ( JSON)5 // Retrieve hero slides (user-defined only) 6 6 $hero_slides_raw = function_exists('mdc_get_option') 7 7 ? mdc_get_option('mdc_hero_slides', '') 8 8 : ''; 9 9 10 // If empty, create a default slide 11 if (empty($hero_slides_raw)) { 12 $hero_slides_raw = wp_json_encode(array( 13 array( 14 'title' => get_the_title(), 15 'subtitle' => get_the_excerpt() ?: __('Your trusted partner for exceptional dental care', 'modern-dental-clinic'), 16 'image' => '', 17 'cta_text' => __('Book Your Appointment', 'modern-dental-clinic'), 18 ), 19 )); 20 } 10 $slides = json_decode($hero_slides_raw, true); 21 11 22 // Decode JSON safely 23 $slides = json_decode($hero_slides_raw, true); 24 if (!is_array($slides) || empty($slides)) { 25 $slides = array( 26 array( 27 'title' => get_the_title(), 28 'subtitle' => __('Your trusted partner for exceptional dental care', 'modern-dental-clinic'), 29 'image' => '', 30 'cta_text' => __('Book Your Appointment', 'modern-dental-clinic'), 31 ), 32 ); 12 if ( ! is_array($slides) || empty($slides) ) { 13 return; 33 14 } 34 15 ?> … … 36 17 <div class="mdc-hero-slides-container"> 37 18 38 <?php foreach ( $slides as $index => $slide) :19 <?php foreach ( $slides as $index => $slide ) : 39 20 40 $bg_image _raw = isset($slide['image']) ? (string) $slide['image'] : '';41 $bg_image_raw = str_replace('\\/', '/', $bg_image_raw);42 $bg_image = esc_url($bg_image_raw);21 $bg_image = ! empty( $slide['image'] ) 22 ? esc_url( str_replace('\\/', '/', (string) $slide['image']) ) 23 : ''; 43 24 44 $slide_title = !empty($slide['title']) ? esc_html($slide['title']) : esc_html__('Welcome', 'modern-dental-clinic'); 45 $slide_subtitle = !empty($slide['subtitle']) ? esc_html($slide['subtitle']) : esc_html__('Your trusted partner for exceptional dental care', 'modern-dental-clinic'); 46 $slide_cta = !empty($slide['cta_text']) ? esc_html($slide['cta_text']) : esc_html__('Book Your Appointment', 'modern-dental-clinic'); 25 $slide_title = ! empty( $slide['title'] ) ? esc_html( $slide['title'] ) : ''; 26 $slide_subtitle = ! empty( $slide['subtitle'] ) ? esc_html( $slide['subtitle'] ) : ''; 27 $slide_cta = ! empty( $slide['cta_text'] ) ? esc_html( $slide['cta_text'] ) : ''; 28 29 if ( ! $slide_title && ! $slide_subtitle && ! $slide_cta && ! $bg_image ) { 30 continue; 31 } 47 32 48 33 $bg_style = $bg_image ? 'background-image: url(' . $bg_image . ');' : ''; 49 34 ?> 50 35 51 <div class="mdc-hero-slide" style="<?php echo esc_attr( $bg_style); ?>">36 <div class="mdc-hero-slide" style="<?php echo esc_attr( $bg_style ); ?>"> 52 37 <div class="mdc-hero-slide-overlay"></div> 53 38 … … 55 40 <div class="mdc-hero-inner"> 56 41 57 <h1 class="mdc-hero-title"><?php echo $slide_title; ?></h1> 42 <?php if ( $slide_title ) : ?> 43 <h1 class="mdc-hero-title"><?php echo $slide_title; ?></h1> 44 <?php endif; ?> 58 45 59 <?php if ( $slide_subtitle) : ?>46 <?php if ( $slide_subtitle ) : ?> 60 47 <p class="mdc-hero-subtitle"><?php echo $slide_subtitle; ?></p> 61 48 <?php endif; ?> 62 49 63 <?php if ( $slide_cta) : ?>50 <?php if ( $slide_cta ) : ?> 64 51 <p> 65 52 <a class="mdc-btn" href="#hours"> … … 77 64 </div> 78 65 79 <?php if (count($slides) > 1) : ?> 80 81 <button class="mdc-hero-prev" aria-label="<?php echo esc_attr__('Previous Slide', 'modern-dental-clinic'); ?>"> 66 <?php if ( count($slides) > 1 ) : ?> 67 <button class="mdc-hero-prev" aria-label="<?php esc_attr_e( 'Previous Slide', 'modern-dental-clinic' ); ?>"> 82 68 <i class="fas fa-chevron-left" aria-hidden="true"></i> 83 69 </button> 84 70 85 <button class="mdc-hero-next" aria-label="<?php e cho esc_attr__('Next Slide', 'modern-dental-clinic'); ?>">71 <button class="mdc-hero-next" aria-label="<?php esc_attr_e( 'Next Slide', 'modern-dental-clinic' ); ?>"> 86 72 <i class="fas fa-chevron-right" aria-hidden="true"></i> 87 73 </button> 88 89 <div class="mdc-hero-dots" role="tablist">90 <?php foreach ($slides as $index => $slide) : ?>91 <button92 class="mdc-hero-dot <?php echo $index === 0 ? 'active' : ''; ?>"93 data-slide="<?php echo esc_attr($index); ?>"94 aria-label="<?php echo esc_attr( sprintf( __( 'Go to slide %d', 'modern-dental-clinic' ), $index + 1 ) ); ?>"95 role="tab"96 aria-selected="<?php echo $index === 0 ? 'true' : 'false'; ?>"97 ></button>98 <?php endforeach; ?>99 </div>100 101 74 <?php endif; ?> 102 75 -
modern-dental-clinic/1.3/template-parts/hours.php
r304257 r305343 1 1 <section class="mdc-hours" id="hours"> 2 2 <div class="mdc-container"> 3 3 4 <?php 4 // Section title with fallback + translation5 $section_title = function_exists( 'mdc_get_option' ) 6 ? mdc_get_option( 'mdc_hours_section_title', __( 'Clinic Hours & Location', 'modern-dental-clinic' ) )7 : __( 'Clinic Hours & Location', 'modern-dental-clinic' );5 // Section title (no default content) 6 $section_title = function_exists( 'mdc_get_option' ) 7 ? trim( mdc_get_option( 'mdc_hours_section_title', '' ) ) 8 : ''; 8 9 ?> 9 10 10 <h2 class="mdc-section-title"><?php echo esc_html( $section_title ); ?></h2> 11 <?php if ( $section_title ) : ?> 12 <h2 class="mdc-section-title"><?php echo esc_html( $section_title ); ?></h2> 13 <?php endif; ?> 11 14 12 15 <div class="mdc-hours-wrapper"> 16 13 17 <div class="mdc-hours-list"> 14 18 15 <h3><?php echo esc_html__( 'Office Hours', 'modern-dental-clinic' ); ?></h3> 19 <?php 20 $office_hours_json = function_exists('mdc_get_option') 21 ? mdc_get_option( 'mdc_office_hours', '' ) 22 : ''; 23 24 $hours_array = json_decode( $office_hours_json, true ); 25 26 if ( is_array( $hours_array ) && ! empty( $hours_array ) ) : 27 ?> 28 <h3><?php esc_html_e( 'Office Hours', 'modern-dental-clinic' ); ?></h3> 29 30 <table class="mdc-hours-table"> 31 <?php foreach ( $hours_array as $row ) : 32 $day = ! empty( $row['day'] ) ? sanitize_text_field( $row['day'] ) : ''; 33 $hours = ! empty( $row['hours'] ) ? sanitize_text_field( $row['hours'] ) : ''; 34 35 if ( ! $day || ! $hours ) { 36 continue; 37 } 38 ?> 39 <tr> 40 <td><strong><?php echo esc_html( $day ); ?></strong></td> 41 <td><?php echo esc_html( $hours ); ?></td> 42 </tr> 43 <?php endforeach; ?> 44 </table> 16 45 17 46 <?php 18 $office_hours_json = function_exists('mdc_get_option') ? mdc_get_option( 'mdc_office_hours', '' ) : ''; 47 elseif ( function_exists('have_rows') && have_rows('mdc_clinic_hours') ) : 48 ?> 49 <h3><?php esc_html_e( 'Office Hours', 'modern-dental-clinic' ); ?></h3> 19 50 20 // OPTION 1 — Custom JSON Saved Through Theme Panel21 if ( ! empty( $office_hours_json ) ) :22 23 $hours_array = json_decode( $office_hours_json, true );24 25 if ( is_array( $hours_array ) && ! empty( $hours_array ) ) :26 ?>27 <table class="mdc-hours-table">28 <?php foreach ( $hours_array as $row ) :29 $day = isset($row['day']) ? sanitize_text_field( $row['day'] ) : '';30 $hours = isset($row['hours']) ? sanitize_text_field( $row['hours'] ) : '';31 32 if ( $day && $hours ) : ?>33 <tr>34 <td><strong><?php echo esc_html( $day ); ?></strong></td>35 <td><?php echo esc_html( $hours ); ?></td>36 </tr>37 <?php endif; ?>38 <?php endforeach; ?>39 </table>40 <?php41 endif;42 43 // OPTION 2 — ACF Repeater (fallback)44 elseif ( function_exists('have_rows') && have_rows('mdc_clinic_hours') ) :45 ?>46 51 <table class="mdc-hours-table"> 47 52 <?php while ( have_rows('mdc_clinic_hours') ) : the_row(); 48 53 $day = get_sub_field('day'); 49 54 $hours = get_sub_field('hours'); 50 ?> 55 56 if ( ! $day || ! $hours ) { 57 continue; 58 } 59 ?> 51 60 <tr> 52 61 <td><strong><?php echo esc_html( $day ); ?></strong></td> … … 55 64 <?php endwhile; ?> 56 65 </table> 66 <?php endif; ?> 57 67 58 <?php59 // OPTION 3 — Hardcoded fallback60 else : ?>61 <div class="mdc-hours-fallback">62 <p><strong><?php echo esc_html__( 'Monday - Friday:', 'modern-dental-clinic' ); ?></strong> 9:00 AM - 6:00 PM</p>63 <p><strong><?php echo esc_html__( 'Saturday:', 'modern-dental-clinic' ); ?></strong> 10:00 AM - 4:00 PM</p>64 <p><strong><?php echo esc_html__( 'Sunday:', 'modern-dental-clinic' ); ?></strong> <?php echo esc_html__( 'Closed', 'modern-dental-clinic' ); ?></p>65 </div>66 <?php endif; ?>67 68 </div> 68 69 69 70 <div class="mdc-location-info"> 70 <h3><?php echo esc_html__( 'Get in Touch', 'modern-dental-clinic' ); ?></h3>71 71 72 72 <?php 73 // Option values with translation-ready fallbacks 74 $clinic_address = mdc_get_option( 'mdc_clinic_address', __( '123 Main Street, Your City, State 12345', 'modern-dental-clinic' ) ); 75 $clinic_phone = mdc_get_option( 'mdc_clinic_phone', '555-123-4567' ); 76 $clinic_email = mdc_get_option( 'mdc_clinic_email', get_option('admin_email') ); 73 $clinic_address = function_exists('mdc_get_option') 74 ? trim( mdc_get_option( 'mdc_clinic_address', '' ) ) 75 : ''; 76 77 $clinic_phone = function_exists('mdc_get_option') 78 ? trim( mdc_get_option( 'mdc_clinic_phone', '' ) ) 79 : ''; 80 81 $clinic_email = function_exists('mdc_get_option') 82 ? trim( mdc_get_option( 'mdc_clinic_email', '' ) ) 83 : ''; 77 84 ?> 78 85 79 <?php if ( ! empty( $clinic_address ) ) : ?> 86 <?php if ( $clinic_address || $clinic_phone || $clinic_email ) : ?> 87 <h3><?php esc_html_e( 'Get in Touch', 'modern-dental-clinic' ); ?></h3> 88 <?php endif; ?> 89 90 <?php if ( $clinic_address ) : ?> 80 91 <p> 81 <strong><?php e cho esc_html__( 'Address:', 'modern-dental-clinic' ); ?></strong><br>92 <strong><?php esc_html_e( 'Address:', 'modern-dental-clinic' ); ?></strong><br> 82 93 <?php echo esc_html( $clinic_address ); ?> 83 94 </p> 84 95 <?php endif; ?> 85 96 86 <?php if ( ! empty( $clinic_phone )) : ?>97 <?php if ( $clinic_phone ) : ?> 87 98 <p> 88 <strong><?php e cho esc_html__( 'Phone:', 'modern-dental-clinic' ); ?></strong><br>99 <strong><?php esc_html_e( 'Phone:', 'modern-dental-clinic' ); ?></strong><br> 89 100 <a href="tel:<?php echo esc_attr( preg_replace('/\D/', '', $clinic_phone) ); ?>"> 90 101 <?php echo esc_html( $clinic_phone ); ?> … … 93 104 <?php endif; ?> 94 105 95 <?php if ( ! empty( $clinic_email )) : ?>106 <?php if ( $clinic_email ) : ?> 96 107 <p> 97 <strong><?php e cho esc_html__( 'Email:', 'modern-dental-clinic' ); ?></strong><br>108 <strong><?php esc_html_e( 'Email:', 'modern-dental-clinic' ); ?></strong><br> 98 109 <a href="mailto:<?php echo esc_attr( $clinic_email ); ?>"> 99 110 <?php echo esc_html( $clinic_email ); ?> … … 102 113 <?php endif; ?> 103 114 104 <!-- <a href="#contact" class="mdc-btn">105 <?php //echo esc_html__( 'Schedule Appointment', 'modern-dental-clinic' ); ?>106 </a> -->107 108 115 </div> 109 116 </div> -
modern-dental-clinic/1.3/template-parts/pricing.php
r304257 r305343 1 1 <section class="mdc-pricing" id="pricing"> 2 2 <div class="mdc-container"> 3 3 4 <?php 4 $section_title = function_exists('mdc_get_option') ? mdc_get_option('mdc_pricing_section_title', __('Our Pricing Plans', 'modern-dental-clinic')) : __('Our Pricing Plans', 'modern-dental-clinic'); 5 $section_subtitle = function_exists('mdc_get_option') ? mdc_get_option('mdc_pricing_section_subtitle', __('Affordable dental care for the whole family', 'modern-dental-clinic')) : __('Affordable dental care for the whole family', 'modern-dental-clinic'); 6 $pricing_plans = function_exists('mdc_get_pricing') ? mdc_get_pricing() : array(); 5 $section_title = function_exists('mdc_get_option') 6 ? trim( mdc_get_option('mdc_pricing_section_title', '') ) 7 : ''; 8 9 $section_subtitle = function_exists('mdc_get_option') 10 ? trim( mdc_get_option('mdc_pricing_section_subtitle', '') ) 11 : ''; 12 13 $pricing_plans = function_exists('mdc_get_pricing') 14 ? mdc_get_pricing() 15 : array(); 7 16 ?> 8 17 9 <h2 class="mdc-section-title"><?php echo esc_html($section_title); ?></h2> 10 11 <?php if (!empty($section_subtitle)) : ?> 12 <p class="mdc-section-subtitle"><?php echo esc_html($section_subtitle); ?></p> 18 <?php if ( $section_title ) : ?> 19 <h2 class="mdc-section-title"><?php echo esc_html( $section_title ); ?></h2> 13 20 <?php endif; ?> 14 21 15 <div class="mdc-pricing-grid"> 16 <?php if (!empty($pricing_plans)) : ?> 22 <?php if ( $section_subtitle ) : ?> 23 <p class="mdc-section-subtitle"><?php echo esc_html( $section_subtitle ); ?></p> 24 <?php endif; ?> 17 25 18 <?php foreach ($pricing_plans as $plan) : ?> 19 <?php 20 $is_popular = !empty($plan['popular']); 21 $plan_name = isset($plan['name']) ? esc_html($plan['name']) : ''; 22 $description = isset($plan['description']) ? esc_html($plan['description']) : ''; 23 $price = isset($plan['price']) ? esc_html($plan['price']) : ''; 24 $period = isset($plan['period']) ? esc_html($plan['period']) : ''; 25 $cta_text = isset($plan['cta_text']) ? esc_html($plan['cta_text']) : ''; 26 ?> 26 <?php if ( ! empty( $pricing_plans ) && is_array( $pricing_plans ) ) : ?> 27 <div class="mdc-pricing-grid"> 28 29 <?php foreach ( $pricing_plans as $plan ) : 30 31 $plan_name = ! empty( $plan['name'] ) ? esc_html( $plan['name'] ) : ''; 32 $description = ! empty( $plan['description'] ) ? esc_html( $plan['description'] ) : ''; 33 $price = ! empty( $plan['price'] ) ? esc_html( $plan['price'] ) : ''; 34 $period = ! empty( $plan['period'] ) ? esc_html( $plan['period'] ) : ''; 35 $cta_text = ! empty( $plan['cta_text'] ) ? esc_html( $plan['cta_text'] ) : ''; 36 $is_popular = ! empty( $plan['popular'] ); 37 38 if ( ! $plan_name && ! $price ) { 39 continue; 40 } 41 ?> 27 42 <div class="mdc-plan <?php echo $is_popular ? 'popular' : ''; ?>"> 28 43 29 <?php if ( $is_popular) : ?>44 <?php if ( $is_popular ) : ?> 30 45 <div class="mdc-plan-badge"> 31 <?php e cho esc_html__('Most Popular', 'modern-dental-clinic'); ?>46 <?php esc_html_e( 'Most Popular', 'modern-dental-clinic' ); ?> 32 47 </div> 33 48 <?php endif; ?> 34 49 35 <h3><?php echo esc_html($plan_name); ?></h3> 36 37 <?php if (!empty($description)) : ?> 38 <p class="mdc-plan-description"><?php echo esc_html($description); ?></p> 50 <?php if ( $plan_name ) : ?> 51 <h3><?php echo $plan_name; ?></h3> 39 52 <?php endif; ?> 40 53 41 <div class="mdc-price-container"> 42 <div class="mdc-price"><?php echo esc_html($price); ?></div> 43 <?php if (!empty($period)) : ?> 44 <div class="mdc-price-period"><?php echo esc_html($period); ?></div> 45 <?php endif; ?> 46 </div> 54 <?php if ( $description ) : ?> 55 <p class="mdc-plan-description"><?php echo $description; ?></p> 56 <?php endif; ?> 47 57 48 <?php if (!empty($plan['features'])) : ?> 49 <?php $features = array_map('trim', explode(',', $plan['features'])); ?> 58 <?php if ( $price ) : ?> 59 <div class="mdc-price-container"> 60 <div class="mdc-price"><?php echo $price; ?></div> 61 <?php if ( $period ) : ?> 62 <div class="mdc-price-period"><?php echo $period; ?></div> 63 <?php endif; ?> 64 </div> 65 <?php endif; ?> 66 67 <?php 68 if ( ! empty( $plan['features'] ) ) : 69 $features = array_filter( array_map( 'trim', explode( ',', $plan['features'] ) ) ); 70 ?> 50 71 <ul class="mdc-plan-features"> 51 <?php foreach ($features as $feature) : ?> 52 <?php if (!empty($feature)) : ?> 53 <li> 54 <i class="fas fa-check"></i> 55 <?php echo esc_html($feature); ?> 56 </li> 57 <?php endif; ?> 72 <?php foreach ( $features as $feature ) : ?> 73 <li> 74 <i class="fas fa-check" aria-hidden="true"></i> 75 <?php echo esc_html( $feature ); ?> 76 </li> 58 77 <?php endforeach; ?> 59 78 </ul> 60 79 <?php endif; ?> 61 80 62 <a class="mdc-btn <?php echo esc_html($is_popular) ? 'mdc-btn-primary' : ''; ?>" href="#hours"> 63 <?php echo esc_html($cta_text); ?> 64 </a> 81 <?php if ( $cta_text ) : ?> 82 <a class="mdc-btn <?php echo $is_popular ? 'mdc-btn-primary' : ''; ?>" href="#hours"> 83 <?php echo $cta_text; ?> 84 </a> 85 <?php endif; ?> 65 86 66 87 </div> 67 88 <?php endforeach; ?> 68 89 69 <?php else : ?> 70 <!-- Fallback pricing plans --> 71 <div class="mdc-plan"> 72 <h3><?php echo esc_html__('Basic', 'modern-dental-clinic'); ?></h3> 73 <p class="mdc-plan-description"><?php echo esc_html__('Essential dental care', 'modern-dental-clinic'); ?></p> 90 </div> 91 <?php endif; ?> 74 92 75 <div class="mdc-price-container">76 <div class="mdc-price"><?php echo esc_html__('Free', 'modern-dental-clinic'); ?></div>77 <div class="mdc-price-period"><?php echo esc_html__('Always', 'modern-dental-clinic'); ?></div>78 </div>79 80 <ul class="mdc-plan-features">81 <li><i class="fas fa-check"></i> <?php echo esc_html__('Initial consultation', 'modern-dental-clinic'); ?></li>82 <li><i class="fas fa-check"></i> <?php echo esc_html__('Basic examination', 'modern-dental-clinic'); ?></li>83 <li><i class="fas fa-check"></i> <?php echo esc_html__('Oral health tips', 'modern-dental-clinic'); ?></li>84 </ul>85 86 <a class="mdc-btn" href="#hours">87 <?php echo esc_html__('Get Started', 'modern-dental-clinic'); ?>88 </a>89 </div>90 91 <div class="mdc-plan popular">92 <div class="mdc-plan-badge"><?php echo esc_html__('Most Popular', 'modern-dental-clinic'); ?></div>93 <h3><?php echo esc_html__('Pro', 'modern-dental-clinic'); ?></h3>94 <p class="mdc-plan-description"><?php echo esc_html__('Comprehensive care', 'modern-dental-clinic'); ?></p>95 96 <div class="mdc-price-container">97 <div class="mdc-price"><?php echo esc_html('$499'); ?></div>98 <div class="mdc-price-period"><?php echo esc_html__('Per Visit', 'modern-dental-clinic'); ?></div>99 </div>100 101 <ul class="mdc-plan-features">102 <li><i class="fas fa-check"></i> <?php echo esc_html__('Everything in Basic', 'modern-dental-clinic'); ?></li>103 <li><i class="fas fa-check"></i> <?php echo esc_html__('Professional cleaning', 'modern-dental-clinic'); ?></li>104 <li><i class="fas fa-check"></i> <?php echo esc_html__('Advanced procedures', 'modern-dental-clinic'); ?></li>105 <li><i class="fas fa-check"></i> <?php echo esc_html__('Priority scheduling', 'modern-dental-clinic'); ?></li>106 </ul>107 108 <a class="mdc-btn mdc-btn-primary" href="#hours">109 <?php echo esc_html__('Choose Plan', 'modern-dental-clinic'); ?>110 </a>111 </div>112 113 <?php endif; ?>114 </div>115 93 </div> 116 94 </section> -
modern-dental-clinic/1.3/template-parts/services.php
r304257 r305343 2 2 <div class="mdc-container"> 3 3 <?php 4 $section_title = function_exists('mdc_get_option') 5 ? mdc_get_option('mdc_services_section_title', __('Our Dental Services', 'modern-dental-clinic')) 6 : __('Our Dental Services', 'modern-dental-clinic'); 4 $section_title = function_exists('mdc_get_option') 5 ? mdc_get_option( 6 'mdc_services_section_title', 7 __('Our Services', 'modern-dental-clinic') 8 ) 9 : __('Our Services', 'modern-dental-clinic'); 7 10 8 $services = function_exists('mdc_get_services') ? mdc_get_services() : array(); 11 $services = function_exists('mdc_get_services') 12 ? mdc_get_services() 13 : array(); 9 14 ?> 10 11 <h2 class="mdc-section-title"><?php echo esc_html($section_title); ?></h2> 15 16 <h2 class="mdc-section-title"> 17 <?php echo esc_html($section_title); ?> 18 </h2> 12 19 13 20 <div class="mdc-services-grid"> … … 15 22 16 23 <?php foreach ($services as $item) : ?> 24 <?php 25 $title = isset($item['title']) ? $item['title'] : ''; 26 $content = isset($item['content']) ? $item['content'] : ''; 27 ?> 17 28 <div class="mdc-service-card"> 18 <h3><?php echo esc_html($item['title']); ?></h3> 19 <p><?php echo esc_html($item['content']); ?></p> 29 <?php if (!empty($title)) : ?> 30 <h3><?php echo esc_html($title); ?></h3> 31 <?php endif; ?> 32 33 <?php if (!empty($content)) : ?> 34 <p><?php echo esc_html($content); ?></p> 35 <?php endif; ?> 36 20 37 <a href="#hours" class="mdc-btn mdc-btn-sm"> 21 38 <?php esc_html_e('Book Now', 'modern-dental-clinic'); ?> … … 24 41 <?php endforeach; ?> 25 42 26 <?php elseif (function_exists('have_rows') && have_rows('mdc_services')) : ?>27 28 <?php while (have_rows('mdc_services')) : the_row();29 $title = get_sub_field('title');30 $icon = get_sub_field('icon');31 $text = get_sub_field('text');32 $price = get_sub_field('price');33 ?>34 <div class="mdc-service-card">35 36 <?php if (!empty($icon)) : ?>37 <div class="mdc-service-icon">38 <img src="<?php echo esc_url($icon['url']); ?>"39 alt="<?php echo esc_attr($title); ?>">40 </div>41 <?php endif; ?>42 43 <h3><?php echo esc_html($title); ?></h3>44 <p><?php echo wp_kses_post($text); ?></p>45 46 <?php if (!empty($price)) : ?>47 <div class="mdc-service-price">48 <?php esc_html_e('Starting from:', 'modern-dental-clinic'); ?>49 <strong><?php echo esc_html($price); ?></strong>50 </div>51 <?php endif; ?>52 53 <a href="#hours" class="mdc-btn mdc-btn-sm">54 <?php esc_html_e('Book Now', 'modern-dental-clinic'); ?>55 </a>56 </div>57 58 <?php endwhile; ?>59 60 43 <?php else : ?> 61 44 62 <?php 63 // Fallback default services 64 $default_services = array( 65 array( 66 'title' => __('General Checkup', 'modern-dental-clinic'), 67 'desc' => __('Comprehensive dental examination and preventive care for your oral health.', 'modern-dental-clinic') 68 ), 69 array( 70 'title' => __('Teeth Cleaning', 'modern-dental-clinic'), 71 'desc' => __('Professional cleaning to remove plaque and tartar buildup.', 'modern-dental-clinic') 72 ), 73 array( 74 'title' => __('Teeth Whitening', 'modern-dental-clinic'), 75 'desc' => __('Professional whitening treatments for a brighter, more confident smile.', 'modern-dental-clinic') 76 ), 77 array( 78 'title' => __('Dental Implants', 'modern-dental-clinic'), 79 'desc' => __('Permanent tooth replacement solution for missing teeth.', 'modern-dental-clinic') 80 ), 81 array( 82 'title' => __('Root Canal', 'modern-dental-clinic'), 83 'desc' => __('Advanced treatment to save infected or damaged teeth.', 'modern-dental-clinic') 84 ), 85 array( 86 'title' => __('Orthodontics', 'modern-dental-clinic'), 87 'desc' => __('Braces and aligners to straighten teeth and improve bite.', 'modern-dental-clinic') 88 ), 89 ); 90 ?> 91 92 <?php foreach ($default_services as $service) : ?> 93 <div class="mdc-service-card"> 94 <h3><?php echo esc_html($service['title']); ?></h3> 95 <p><?php echo esc_html($service['desc']); ?></p> 96 <a href="#hours" class="mdc-btn mdc-btn-sm"> 97 <?php esc_html_e('Book Now', 'modern-dental-clinic'); ?> 98 </a> 99 </div> 100 <?php endforeach; ?> 45 <p class="mdc-empty-message"> 46 <?php esc_html_e( 47 'Please add services from the theme settings.', 48 'modern-dental-clinic' 49 ); ?> 50 </p> 101 51 102 52 <?php endif; ?> -
modern-dental-clinic/1.3/template-parts/team.php
r302518 r305343 4 4 <?php 5 5 $section_title = function_exists('mdc_get_option') 6 ? mdc_get_option('mdc_team_section_title', __('Meet Our Dental Team', 'modern-dental-clinic')) 7 : __('Meet Our Dental Team', 'modern-dental-clinic'); 6 ? mdc_get_option( 7 'mdc_team_section_title', 8 __('Our Team', 'modern-dental-clinic') 9 ) 10 : __('Our Team', 'modern-dental-clinic'); 8 11 9 $team = function_exists('mdc_get_team') ? mdc_get_team() : array(); 12 $team = function_exists('mdc_get_team') 13 ? mdc_get_team() 14 : array(); 10 15 ?> 11 16 12 <h2 class="mdc-section-title"><?php echo esc_html($section_title); ?></h2> 17 <h2 class="mdc-section-title"> 18 <?php echo esc_html($section_title); ?> 19 </h2> 13 20 14 21 <div class="mdc-team-grid"> … … 17 24 18 25 <?php foreach ($team as $member) : ?> 19 <div class="mdc-team-member">20 26 21 <?php if (!empty($member['image'])) : 22 // Normalize potential escaped slashes and ensure a usable URL 23 $raw_img = is_string($member['image']) ? $member['image'] : ''; 24 $raw_img = str_replace('\\/', '/', $raw_img); 25 $raw_img = trim($raw_img); 27 <?php 28 $name = isset($member['name']) ? $member['name'] : ''; 29 $role = isset($member['role']) ? $member['role'] : ''; 30 $bio = isset($member['bio']) ? $member['bio'] : ''; 31 $image = isset($member['image']) ? $member['image'] : ''; 32 ?> 26 33 27 // Convert relative path to absolute URI28 if ($raw_img !== '' && strpos($raw_img, 'http') !== 0 && strpos($raw_img, '//') !== 0) {29 $raw_img = get_stylesheet_directory_uri() . '/' . ltrim($raw_img, '/');30 }31 ?>32 <div class="mdc-team-image">33 <img src="<?php echo esc_url($raw_img); ?>"34 alt="<?php echo esc_attr($member['name']); ?>">35 </div>36 <?php endif; ?>37 38 <h3><?php echo esc_html($member['name']); ?></h3>39 40 <?php if (!empty($member['role'])) : ?>41 <p class="mdc-member-title"><?php echo esc_html($member['role']); ?></p>42 <?php endif; ?>43 44 <?php if (!empty($member['bio'])) : ?>45 <p><?php echo esc_html($member['bio']); ?></p>46 <?php endif; ?>47 48 <?php if (!empty($member['socials']) && is_array($member['socials'])) : ?>49 <div class="mdc-team-socials">50 <?php foreach ($member['socials'] as $key => $url) :51 52 $url = is_string($url) ? $url : '';53 $url = str_replace('\\/', '/', $url);54 $url = esc_url($url);55 56 if (empty($url)) {57 continue;58 }59 60 // Determine provider61 $provider = '';62 $key_s = sanitize_key((string)$key);63 64 if ($key_s !== '' && !is_numeric($key_s)) {65 $provider = $key_s;66 } else {67 $host = strtolower(parse_url($url, PHP_URL_HOST) ?: '');68 69 if (strpos($host, 'facebook.com') !== false || strpos($host, 'fb.me') !== false) { $provider = 'facebook'; }70 elseif (strpos($host, 'twitter.com') !== false || strpos($host, 't.co') !== false) { $provider = 'twitter'; }71 elseif (strpos($host, 'instagram.com') !== false) { $provider = 'instagram'; }72 elseif (strpos($host, 'linkedin.com') !== false) { $provider = 'linkedin'; }73 elseif (strpos($host, 'youtube.com') !== false || strpos($host, 'youtu.be') !== false) { $provider = 'youtube'; }74 else { $provider = 'website'; }75 }76 77 // Icon class78 switch ($provider) {79 case 'facebook': $icon = 'fab fa-facebook-f'; break;80 case 'twitter': $icon = 'fab fa-twitter'; break;81 case 'instagram': $icon = 'fab fa-instagram'; break;82 case 'linkedin': $icon = 'fab fa-linkedin-in'; break;83 case 'youtube': $icon = 'fab fa-youtube'; break;84 default: $icon = 'fas fa-link';85 }86 ?>87 88 <a class="mdc-team-social"89 href="<?php echo esc_url($url); ?>"90 target="_blank"91 rel="noopener noreferrer">92 <i class="<?php echo esc_attr($icon); ?>" aria-hidden="true"></i>93 </a>94 95 <?php endforeach; ?>96 </div>97 <?php endif; ?>98 99 </div>100 <?php endforeach; ?>101 102 <?php elseif (function_exists('have_rows') && have_rows('mdc_doctors')) : ?>103 104 <?php while (have_rows('mdc_doctors')) : the_row();105 $name = get_sub_field('name');106 $title = get_sub_field('title');107 $image = get_sub_field('image');108 $bio = get_sub_field('bio');109 ?>110 34 <div class="mdc-team-member"> 111 35 112 36 <?php if (!empty($image)) : ?> 113 37 <div class="mdc-team-image"> 114 <img src="<?php echo esc_url($image['url']); ?>" 115 alt="<?php echo esc_attr($name); ?>"> 38 <img 39 src="<?php echo esc_url($image); ?>" 40 alt="<?php echo esc_attr($name); ?>"> 116 41 </div> 117 42 <?php endif; ?> 118 43 119 <h3><?php echo esc_html($name); ?></h3> 44 <?php if (!empty($name)) : ?> 45 <h3><?php echo esc_html($name); ?></h3> 46 <?php endif; ?> 120 47 121 <p class="mdc-member-title"><?php echo esc_html($title); ?></p> 48 <?php if (!empty($role)) : ?> 49 <p class="mdc-member-title"> 50 <?php echo esc_html($role); ?> 51 </p> 52 <?php endif; ?> 122 53 123 54 <?php if (!empty($bio)) : ?> 124 <p><?php echo wp_kses_post($bio); ?></p>55 <p><?php echo esc_html($bio); ?></p> 125 56 <?php endif; ?> 126 57 127 58 </div> 128 <?php endwhile; ?> 59 60 <?php endforeach; ?> 129 61 130 62 <?php else : ?> 131 63 132 <?php 133 // Fallback team members 134 $default_team = array( 135 array( 136 'name' => __('Dr. Smith', 'modern-dental-clinic'), 137 'title' => __('BDS, General Dentist', 'modern-dental-clinic'), 138 'bio' => __('15+ years of experience in general dentistry.', 'modern-dental-clinic') 139 ), 140 array( 141 'name' => __('Dr. Johnson', 'modern-dental-clinic'), 142 'title' => __('MDS, Orthodontist', 'modern-dental-clinic'), 143 'bio' => __('Specializing in cosmetic and corrective orthodontics.', 'modern-dental-clinic') 144 ), 145 array( 146 'name' => __('Dr. Williams', 'modern-dental-clinic'), 147 'title' => __('BDS, Dental Hygienist', 'modern-dental-clinic'), 148 'bio' => __('Dedicated to preventive care and patient education.', 'modern-dental-clinic') 149 ), 150 ); 151 ?> 152 153 <?php foreach ($default_team as $member) : ?> 154 <div class="mdc-team-member"> 155 <h3><?php echo esc_html($member['name']); ?></h3> 156 <p class="mdc-member-title"><?php echo esc_html($member['title']); ?></p> 157 <p><?php echo esc_html($member['bio']); ?></p> 158 </div> 159 <?php endforeach; ?> 64 <p class="mdc-empty-message"> 65 <?php esc_html_e( 66 'Please add team members from the theme settings.', 67 'modern-dental-clinic' 68 ); ?> 69 </p> 160 70 161 71 <?php endif; ?> -
modern-dental-clinic/1.3/template-parts/testimonials.php
r302518 r305343 3 3 4 4 <?php 5 // Section title (with fallback) 6 $section_title = function_exists('mdc_get_option') 7 ? mdc_get_option('mdc_testimonials_section_title', __('What Our Patients Say', 'modern-dental-clinic')) 8 : __('What Our Patients Say', 'modern-dental-clinic'); 5 $section_title = function_exists('mdc_get_option') 6 ? mdc_get_option( 7 'mdc_testimonials_section_title', 8 __('Testimonials', 'modern-dental-clinic') 9 ) 10 : __('Testimonials', 'modern-dental-clinic'); 9 11 10 // Get testimonials 11 $testimonials = function_exists('mdc_get_testimonials') 12 ? mdc_get_testimonials() 13 : array(); 12 $testimonials = function_exists('mdc_get_testimonials') 13 ? mdc_get_testimonials() 14 : array(); 14 15 ?> 15 16 16 <h2 class="mdc-section-title"><?php echo esc_html($section_title); ?></h2> 17 <h2 class="mdc-section-title"> 18 <?php echo esc_html($section_title); ?> 19 </h2> 17 20 18 21 <div class="mdc-testimonial-list"> … … 25 28 $author = isset($t['author']) ? esc_html($t['author']) : ''; 26 29 27 if ( $content === '') {30 if (empty($content)) { 28 31 continue; 29 32 } … … 31 34 <blockquote class="mdc-testimonial"> 32 35 <?php echo $content; ?> 33 <?php if ( $author) : ?>36 <?php if (!empty($author)) : ?> 34 37 <cite>— <?php echo esc_html($author); ?></cite> 35 38 <?php endif; ?> … … 39 42 <?php else : ?> 40 43 41 <?php 42 // Fallback testimonials (translation ready) 43 $fallbacks = array( 44 array( 45 'content' => __('"Excellent dental care! Dr. Smith was very professional and friendly. I recommend this clinic to everyone."', 'modern-dental-clinic'), 46 'author' => __('Sarah M.', 'modern-dental-clinic'), 47 ), 48 array( 49 'content' => __('"Amazing experience from start to finish. The staff is welcoming and the facilities are very clean."', 'modern-dental-clinic'), 50 'author' => __('John P.', 'modern-dental-clinic'), 51 ), 52 array( 53 'content' => __('"My teeth have never looked better! The teeth whitening treatment was fantastic and painless."', 'modern-dental-clinic'), 54 'author' => __('Maria R.', 'modern-dental-clinic'), 55 ), 56 array( 57 'content' => __('"I was nervous about my root canal, but the team made me feel comfortable. Highly recommended!"', 'modern-dental-clinic'), 58 'author' => __('David L.', 'modern-dental-clinic'), 59 ), 60 ); 61 62 foreach ($fallbacks as $fb) : ?> 63 <blockquote class="mdc-testimonial"> 64 <?php echo wp_kses_post($fb['content']); ?> 65 <cite>— <?php echo esc_html($fb['author']); ?></cite> 66 </blockquote> 67 <?php endforeach; ?> 44 <p class="mdc-empty-message"> 45 <?php esc_html_e( 46 'No testimonials added yet. You can add testimonials from the theme settings.', 47 'modern-dental-clinic' 48 ); ?> 49 </p> 68 50 69 51 <?php endif; ?> 52 70 53 </div> 71 54 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)