<?php
/**
 * Echo the structural markup for the main content. It also calls the content action hooks.
 *
 * @package SplendorStudio\Framework\Templates\Structure
 *
 * @since   1.0.0
 * @since   1.5.0 Added ID and tabindex for skip links.
 */

$fancify_lite_content_attributes = array(
	'class'    => 'fancify-content',
	'id'       => 'fancify-content',
	'role'     => 'main',
	'itemprop' => 'mainEntityOfPage',
	'tabindex' => '-1',
);

// Blog specific attributes.
if (is_home() || is_page_template('page_blog.php') || is_singular('post') || is_archive()) {

	$fancify_lite_content_attributes['itemscope'] = 'itemscope'; // Automatically escaped.
	$fancify_lite_content_attributes['itemtype']  = 'https://schema.org/Blog'; // Automatically escaped.

}

// Blog specific attributes.
if (is_search()) {

	$fancify_lite_content_attributes['itemscope'] = 'itemscope'; // Automatically escaped.
	$fancify_lite_content_attributes['itemtype']  = 'https://schema.org/SearchResultsPage'; // Automatically escaped.

}
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

fancify_lite_open_markup_e('fancify_lite_content', 'div', $fancify_lite_content_attributes);

/**
 * Fires in the main content.
 *
 * @since 1.0.0
 */
do_action('fancify_lite_content');

fancify_lite_close_markup_e('fancify_lite_content', 'div');