
    blackcam_create_page('Contact','contact','templates/page-contact.php');
    if($home){
        update_option('show_on_front','page');
        update_option('page_on_front',$home);
    }

    $menu_name = 'BlackCam Main Menu';
    $menu = wp_get_nav_menu_object($menu_name);
    if(!$menu){
        $menu_id = wp_create_nav_menu($menu_name);
        $pages = array('Home'=>'home','About'=>'about','Services'=>'services','Gallery'=>'gallery','Packages'=>'packages','Contact'=>'contact');
        foreach($pages as $label=>$slug){
            $p = get_page_by_path($slug);
            if($p){
                wp_update_nav_menu_item($menu_id, 0, array(
                    'menu-item-title'=>$label,
                    'menu-item-object'=>'page',
                    'menu-item-object-id'=>$p->ID,
                    'menu-item-type'=>'post_type',
                    'menu-item-status'=>'publish'
                ));
            }
        }
        $locations = get_theme_mod('nav_menu_locations');
        $locations['primary'] = $menu_id;
        set_theme_mod('nav_menu_locations', $locations);
    }
}
add_action('after_switch_theme','blackcam_auto_pages');

function blackcam_img($file){
    return esc_url(get_template_directory_uri() . '/assets/images/' . $file);
}

function blackcam_local_business_schema(){
    if(!is_front_page()) return;

    $schema = array(
        '@context' => 'https://schema.org',
        '@type' => 'LocalBusiness',
        '@id' => home_url('/#blackcam-local-business'),
        'name' => 'BlackCam Productions',
        'description' => 'Studio photography, weddings, events, videography and visual production.',
        'url' => home_url('/'),
        'image' => blackcam_img('portfolio-6.jpg'),
        'logo' => blackcam_img('blackcam-logo.jpg'),
        'telephone' => '+27791073364',
        'email' => 'info@blackcam.co.za',
        'foundingDate' => '2017',
        'address' => array(
            '@type' => 'PostalAddress',
            'streetAddress' => 'Vergelegen C',
            'addressLocality' => 'Jane Furse',
            'addressRegion' => 'Limpopo',
            'addressCountry' => 'ZA'
        ),
        'areaServed' => array(
            '@type' => 'AdministrativeArea',
            'name' => 'Limpopo'
        ),
        'sameAs' => array(
            'https://www.facebook.com/BlackCamPhotography',
            'https://www.instagram.com/BlackCamPhotography/',
            'https://www.tiktok.com/@blackcam_photography'
        )
    );

    echo '<script type="application/ld+json">' . wp_json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</script>' . "\n";
}
add_action('wp_head','blackcam_local_business_schema',3);
?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://blackcam.co.za/sitemaps.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap>
							<loc>https://blackcam.co.za/post-sitemap1.xml</loc>
							<lastmod>2026-05-02T11:51:23+00:00</lastmod>
						</sitemap><sitemap>
							<loc>https://blackcam.co.za/page-sitemap1.xml</loc>
							<lastmod>2026-09-14T10:20:16+00:00</lastmod>
						</sitemap><sitemap>	
							<loc>https://blackcam.co.za/category-sitemap1.xml</loc>
							<lastmod>2026-09-15T20:50:53+00:00</lastmod>
						</sitemap></sitemapindex>