{"id":46,"date":"2025-04-02T21:16:00","date_gmt":"2025-04-02T19:16:00","guid":{"rendered":"http:\/\/holistap.com\/?page_id=46"},"modified":"2025-04-02T21:22:01","modified_gmt":"2025-04-02T19:22:01","slug":"wyniki-wyszukiwania","status":"publish","type":"page","link":"http:\/\/holistap.com\/index.php\/wyniki-wyszukiwania\/","title":{"rendered":"Wyniki wyszukiwania"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"46\" class=\"elementor elementor-46\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-e1a5a31 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e1a5a31\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3bbe420\" data-id=\"3bbe420\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b43e545 elementor-widget elementor-widget-html\" data-id=\"b43e545\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<?php\n\/**\n * Template Name: Wyniki wyszukiwania\n *\/\n\nget_header();\n\n\/\/ Pobierz parametry wyszukiwania\n$keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';\n$location = isset($_GET['location']) ? sanitize_text_field($_GET['location']) : '';\n$type = isset($_GET['type']) ? sanitize_text_field($_GET['type']) : 'all';\n\n\/\/ Okre\u015bl typy post\u00f3w do wyszukiwania\n$post_types = array('specialist', 'event');\nif ($type === 'uslugi') {\n    $post_types = array('specialist');\n} elseif ($type === 'wydarzenia') {\n    $post_types = array('event');\n}\n\n\/\/ Argumenty zapytania\n$args = array(\n    'post_type' => $post_types,\n    'posts_per_page' => 12,\n    's' => $keyword,\n    'paged' => get_query_var('paged') ? get_query_var('paged') : 1\n);\n\n\/\/ Dodaj filtr lokalizacji je\u015bli podano\nif (!empty($location)) {\n    $args['tax_query'] = array(\n        array(\n            'taxonomy' => 'location',\n            'field' => 'name',\n            'terms' => $location,\n            'operator' => 'LIKE'\n        )\n    );\n}\n\n\/\/ Wykonaj zapytanie\n$search_query = new WP_Query($args);\n?>\n\n<div class=\"container search-results-container\" style=\"padding: 80px 20px; max-width: 1200px; margin: 0 auto;\">\n    <h1 class=\"search-results-title\" style=\"color: #3AAFA9; font-size: 2.2rem; margin-bottom: 30px;\">\n        Wyniki wyszukiwania\n    <\/h1>\n    \n    <div class=\"search-filters\" style=\"margin-bottom: 30px; background: #DEF2F1; padding: 20px; border-radius: 8px;\">\n        <form action=\"<?php echo get_permalink(); ?>\" method=\"get\" class=\"search-form\" style=\"display: flex; flex-wrap: wrap; gap: 15px;\">\n            <input type=\"text\" name=\"keyword\" value=\"<?php echo esc_attr($keyword); ?>\" placeholder=\"Czego szukasz?\" style=\"flex: 1; min-width: 200px; padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 4px;\">\n            <input type=\"text\" name=\"location\" value=\"<?php echo esc_attr($location); ?>\" placeholder=\"Lokalizacja\" style=\"flex: 1; min-width: 200px; padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 4px;\">\n            \n            <select name=\"type\" style=\"padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 4px;\">\n                <option value=\"all\" <?php selected($type, 'all'); ?>>Wszystkie<\/option>\n                <option value=\"uslugi\" <?php selected($type, 'uslugi'); ?>>Us\u0142ugi<\/option>\n                <option value=\"wydarzenia\" <?php selected($type, 'wydarzenia'); ?>>Wydarzenia<\/option>\n            <\/select>\n            \n            <button type=\"submit\" style=\"padding: 12px 24px; background-color: #3AAFA9; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: 500;\">\n                Szukaj\n            <\/button>\n        <\/form>\n    <\/div>\n\n    <div class=\"search-results-count\" style=\"margin-bottom: 20px; color: #666;\">\n        Znaleziono <?php echo $search_query->found_posts; ?> wynik\u00f3w dla: <strong><?php echo esc_html($keyword); ?><\/strong>\n        <?php if (!empty($location)): ?>\n            w lokalizacji: <strong><?php echo esc_html($location); ?><\/strong>\n        <?php endif; ?>\n    <\/div>\n\n    <?php if ($search_query->have_posts()): ?>\n        <div class=\"search-results-grid\" style=\"display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px;\">\n            \n            <?php while ($search_query->have_posts()): $search_query->the_post(); ?>\n                <div class=\"result-card\" style=\"border-radius: 12px; overflow: hidden; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); background: white; transition: transform 0.3s, box-shadow 0.3s;\">\n                    \n                    <?php if (has_post_thumbnail()): ?>\n                        <img decoding=\"async\" src=\"<?php echo get_the_post_thumbnail_url(get_the_ID(), 'medium'); ?>\" alt=\"<?php the_title(); ?>\" style=\"width: 100%; height: 180px; object-fit: cover;\">\n                    <?php else: ?>\n                        <div style=\"width: 100%; height: 180px; background-color: #DEF2F1; display: flex; align-items: center; justify-content: center; color: #3AAFA9;\">\n                            <span style=\"font-size: 3rem; opacity: 0.5;\">\n                                <?php echo get_post_type() === 'specialist' ? '\ud83d\udc64' : '\ud83d\udcc5'; ?>\n                            <\/span>\n                        <\/div>\n                    <?php endif; ?>\n                    \n                    <div class=\"result-info\" style=\"padding: 20px;\">\n                        <h3 style=\"margin-bottom: 8px; font-size: 1.1rem; color: #17252A;\">\n                            <a href=\"<?php the_permalink(); ?>\" style=\"color: inherit; text-decoration: none;\">\n                                <?php the_title(); ?>\n                            <\/a>\n                        <\/h3>\n                        \n                        <?php if (get_post_type() === 'specialist'): ?>\n                            <?php \n                            $address = get_field('specialist_address');\n                            if ($address): ?>\n                                <p style=\"color: #666; font-size: 0.9rem; margin-bottom: 10px;\"><?php echo wp_trim_words($address, 10); ?><\/p>\n                            <?php endif; ?>\n                            \n                            <?php \n                            $categories = get_the_terms(get_the_ID(), 'wellness_category');\n                            if ($categories && !is_wp_error($categories)): ?>\n                                <span style=\"display: inline-block; background-color: #DEF2F1; color: #3AAFA9; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem;\">\n                                    <?php echo $categories[0]->name; ?>\n                                <\/span>\n                            <?php endif; ?>\n                            \n                        <?php elseif (get_post_type() === 'event'): ?>\n                            <?php \n                            $location = get_field('event_location');\n                            if ($location): ?>\n                                <p style=\"color: #666; font-size: 0.9rem; margin-bottom: 10px;\"><?php echo wp_trim_words($location, 10); ?><\/p>\n                            <?php endif; ?>\n                            \n                            <?php \n                            $date_start = get_field('event_date_start');\n                            if ($date_start): \n                                $formatted_date = date_i18n('d-m-Y', strtotime($date_start));\n                            ?>\n                                <span style=\"display: inline-block; background-color: #DEF2F1; color: #3AAFA9; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem;\">\n                                    <?php echo $formatted_date; ?>\n                                <\/span>\n                            <?php endif; ?>\n                        <?php endif; ?>\n                    <\/div>\n                <\/div>\n            <?php endwhile; ?>\n            \n        <\/div>\n        \n        <div class=\"pagination\" style=\"margin-top: 40px; text-align: center;\">\n            <?php \n            echo paginate_links(array(\n                'base' => add_query_arg('paged', '%#%'),\n                'format' => '',\n                'prev_text' => __('&laquo; Poprzednie'),\n                'next_text' => __('Nast\u0119pne &raquo;'),\n                'total' => $search_query->max_num_pages,\n                'current' => max(1, get_query_var('paged'))\n            ));\n            ?>\n        <\/div>\n        \n    <?php else: ?>\n        <div class=\"no-results\" style=\"text-align: center; padding: 50px 20px; background: #DEF2F1; border-radius: 8px;\">\n            <h2 style=\"color: #2B7A78; margin-bottom: 15px;\">Nie znaleziono wynik\u00f3w<\/h2>\n            <p style=\"color: #666; max-width: 600px; margin: 0 auto;\">\n                Spr\u00f3buj zmieni\u0107 kryteria wyszukiwania lub przejrzyj list\u0119 wszystkich specjalist\u00f3w i wydarze\u0144.\n            <\/p>\n        <\/div>\n    <?php endif; ?>\n    \n    <?php wp_reset_postdata(); ?>\n<\/div>\n\n<?php get_footer(); ?>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Wyniki wyszukiwania<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-46","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/pages\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":10,"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/pages\/46\/revisions"}],"predecessor-version":[{"id":58,"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/pages\/46\/revisions\/58"}],"wp:attachment":[{"href":"http:\/\/holistap.com\/index.php\/wp-json\/wp\/v2\/media?parent=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}