/*
Theme Name: Houzez Child
Theme URI: http://www.favethemes.com/
Author: Favethemes
Author URI: http://www.favethemes.com/
Description: Houzez is a premium WordPress theme for real estate agents where modern aesthetics are combined with tasteful simplicity, and where the ease of use is achieved without compromise in your ability to customise the design. Whether you are a real estate agent looking to build a website for your company or a web developer seeking a perfect WordPress theme for your next project, you are certain to appreciate the numerous features and benefits that our theme provides.
Version: 1.0
Tags: white, right-sidebar, left-sidebar, custom-colors, custom-menu, featured-images, post-formats, theme-options, translation-ready
License: GNU General Public License version 3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: houzez
Template: houzez
*/


@import url("../houzez/style.css");


/* function send_email_on_page_load() {
    if (is_page('search-results-2')) {  // Replace with the correct page slug or ID
        // Capture the query parameters from the URL
        $user_name = isset($_GET['user_name']) ? sanitize_text_field($_GET['user_name']) : 'Anonymous';
        $type = isset($_GET['type']) ? implode(', ', array_map('sanitize_text_field', $_GET['type'])) : 'Not specified';
        $rooms = isset($_GET['rooms']) ? sanitize_text_field($_GET['rooms']) : 'Not specified';
        $min_price = isset($_GET['min-price']) ? sanitize_text_field($_GET['min-price']) : 'Not specified';
        $max_price = isset($_GET['max-price']) ? sanitize_text_field($_GET['max-price']) : 'Not specified';
        $location = isset($_GET['location']) ? implode(', ', array_map('sanitize_text_field', $_GET['location'])) : 'Not specified';
        $areas = isset($_GET['areas']) ? implode(', ', array_map('sanitize_text_field', $_GET['areas'])) : 'Not specified';

        // Format the email content
        $message = "New search from \"{$user_name}\"\n\n";
        $message .= "Type: {$type}\n";
        $message .= "Rooms: {$rooms}\n";
        $message .= "Min Price: {$min_price}\n";
        $message .= "Max Price: {$max_price}\n";
        $message .= "Location: {$location}\n";
        $message .= "Areas: {$areas}\n";

        // Log the email content to the console
        $script = "console.log('Email Content:\\n" . addslashes($message) . "');";
        wp_add_inline_script('jquery', $script); // Use a registered script handle (e.g., 'jquery')

        // Log the email content to the debug log (useful for testing)
        if (defined('WP_DEBUG') && WP_DEBUG) {
            error_log('Email Content: ' . $message);
        }

        // Set the email parameters
        $to = 'your-email@example.com';
        $subject = 'New Search Request';
        $headers = array('Content-Type: text/plain; charset=UTF-8');

        // Send the email and check if it was successful
        $email_sent = wp_mail($to, $subject, $message, $headers);
        if (!$email_sent) {
            error_log('Failed to send email: ' . $subject);
        }
    }
}
add_action('wp_footer', 'send_email_on_page_load'); */

function custom_console_log_script() {
    // Check if we're on the specific page by URL
    if (is_page() && strpos($_SERVER['REQUEST_URI'], 'search-results-2') !== false) {
        ?>
        <script type="text/javascript">
            console.log("Search Results Page Loaded");
        </script>
        <?php
    }
}

add_action('wp_footer', 'custom_console_log_script');

/* Your CSS code goes here
-------------------------------------- */