/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

function custom_code_for_specific_post() {
    ?>
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "SportsEvent",
        "name": "La Liga: Valencia FC vs Real Betis",
        "description": "La Liga football match between Valencia FC and Real Betis at Estadio Mestalla.",
        "startDate": "2024-11-18T14:00:00+01:00",
        "eventStatus": "https://schema.org/EventScheduled",
        "location": {
            "@type": "Place",
            "name": "Estadio Mestalla",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Av. de Suècia, s/n",
                "addressLocality": "Valencia",
                "addressRegion": "Valencia",
                "postalCode": "46010",
                "addressCountry": "ES"
            }
        },
        "organizer": {
            "@type": "SportsOrganization",
            "name": "La Liga de España",
            "url": "https://www.laliga.com"
        },
        "performers": [
            {
                "@type": "SportsTeam",
                "name": "Valencia FC",
                "coach": {
                    "@type": "Person",
                    "name": "Valencia Coach" 
                }
            },
            {
                "@type": "SportsTeam",
                "name": "Real Betis",
                "coach": {
                    "@type": "Person",
                    "name": "Real Betis Coach" 
                }
            }
        ],
        "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
        "offers": {
            "@type": "Offer",
            "url": "https://www.valenciacf.com/tickets",
            "price": "40",
            "priceCurrency": "EUR",
            "availability": "https://schema.org/InStock",
            "validFrom": "2024-10-01T10:00:00+01:00"
        },
        "potentialAction": {
            "@type": "ReserveAction",
            "target": {
                "@type": "EntryPoint",
                "urlTemplate": "https://www.valenciacf.com/tickets",
                "actionPlatform": [
                    "http://schema.org/DesktopWebPlatform",
                    "http://schema.org/MobileWebPlatform"
                ]
            }
        }
    }
    </script>
    <?php
}
add_action('wp_head', 'custom_code_for_specific_post');


/**
 1. Allow SVG files to be uploaded via Media Uploader
 */
    add_filter( 'upload_mimes', function( $mime_types ) {
        $mime_types['svg'] = 'image/svg+xml';
        return $mime_types;
    }, 1, 1 );

    add_filter( 'wp_check_filetype_and_ext', function( $mime, $file, $filename, $mimes ) {
        $wp_filetype = wp_check_filetype( $filename, $mimes );
        if ( in_array( $wp_filetype['ext'], [ 'svg' ] ) ) {
            $mime['ext']  = true;
            $mime['type'] = true;
        }
        return $mime;
    }, 10, 4 );

