| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { exit; // Exit if accessed directly |
| 3 |
} |
| 4 |
/** |
| 5 |
* @var string $title |
| 6 |
* @var string $description |
| 7 |
* @var string $url |
| 8 |
* @var string $og_title |
| 9 |
* @var string $featured_image |
| 10 |
* @var string $theme_color |
| 11 |
* @var string $landing_route |
| 12 |
* @var bool $isHeadless |
| 13 |
*/ |
| 14 |
$fluentCommunityOgTitle = $og_title ?? ''; |
| 15 |
$fluentCommunityThemeColor = $theme_color ?? ''; |
| 16 |
?> |
| 17 |
<!DOCTYPE html> |
| 18 |
<html <?php language_attributes(); ?><?php echo !empty($html_class) ? ' class="' . esc_attr($html_class) . '"' : ''; ?>> |
| 19 |
<head> |
| 20 |
<title><?php echo esc_attr($title); ?></title> |
| 21 |
<meta charset='utf-8'> |
| 22 |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2.0,user-scalable=yes,viewport-fit=cover"/> |
| 23 |
<meta name="mobile-web-app-capable" content="yes"> |
| 24 |
<?php if (!$isHeadless) : wp_head(); else: ?> |
| 25 |
<meta name="description" content="<?php echo esc_attr($description); ?>"> |
| 26 |
<?php $fluentCommunitySiteIcon = get_site_icon_url(); ?> |
| 27 |
<?php if ($fluentCommunitySiteIcon): ?> |
| 28 |
<link rel="icon" type="image/x-icon" href="<?php echo esc_url($fluentCommunitySiteIcon); ?>"/> |
| 29 |
<?php if (apply_filters('fluent_community/render_default_touch_icon', true)): ?> |
| 30 |
<link rel="apple-touch-icon" href="<?php echo esc_url($fluentCommunitySiteIcon); ?>"/> |
| 31 |
<?php endif; ?> |
| 32 |
<?php endif; ?> |
| 33 |
<meta property="og:type" content="website"> |
| 34 |
<meta property="og:url" content="<?php echo esc_url($url); ?>"> |
| 35 |
<meta property="og:site_name" content="<?php bloginfo('name'); ?>"> |
| 36 |
<meta property="og:title" content="<?php echo esc_attr($fluentCommunityOgTitle); ?>"> |
| 37 |
<meta property="og:description" content="<?php echo esc_attr($description); ?>"> |
| 38 |
<?php if ($featured_image): ?> |
| 39 |
<meta property="og:image" content="<?php echo esc_url($featured_image); ?>"> |
| 40 |
<meta name="twitter:image" content="<?php echo esc_url($featured_image); ?>"> |
| 41 |
<?php endif; ?> |
| 42 |
<meta name="twitter:card" content="summary"> |
| 43 |
<meta name="theme-color" content="<?php echo esc_attr($fluentCommunityThemeColor); ?>"> |
| 44 |
<?php do_action('fluent_community/portal_head_meta', $landing_route); ?> |
| 45 |
|
| 46 |
<?php if(!empty($canonical_url)): ?> |
| 47 |
<link rel="canonical" href="<?php echo esc_url($canonical_url); ?>"> |
| 48 |
<?php endif; ?> |
| 49 |
|
| 50 |
<?php if(!empty($json_ld)): ?><script type="application/ld+json"><?php echo wp_json_encode($json_ld, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?></script> |
| 51 |
<?php endif; ?> |
| 52 |
<?php endif; ?> |
| 53 |
|
| 54 |
|
| 55 |
<?php if (\FluentCommunity\App\Services\Helper::hasColorScheme()): ?> |
| 56 |
<?php \FluentCommunity\App\Services\Helper::renderColorSchemePrePaintScript(); ?> |
| 57 |
<?php endif; ?> |
| 58 |
|
| 59 |
<?php if (\FluentCommunity\App\Services\Helper::isRtl()): ?> |
| 60 |
<style> |
| 61 |
body { |
| 62 |
direction: rtl; |
| 63 |
} |
| 64 |
</style> |
| 65 |
<?php endif; ?> |
| 66 |
|
| 67 |
<style id="fcom_css_vars"> |
| 68 |
<?php echo esc_html(\FluentCommunity\App\Functions\Utility::getColorCssVariables()); ?> |
| 69 |
.dark body .el-dialog { |
| 70 |
--el-dialog-bg-color: #2B2E33; |
| 71 |
} |
| 72 |
</style> |
| 73 |
|
| 74 |
<?php do_action('fluent_community/portal_head'); ?> |
| 75 |
</head> |
| 76 |
<body> |
| 77 |
<div class="fcom_wrap"> |
| 78 |
<?php do_action('fluent_community/before_portal_dom'); ?> |
| 79 |
<div class="fluent_com"> |
| 80 |
<?php do_action('fluent_community/portal_html'); ?> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
<?php do_action('fluent_community/before_js_loaded'); ?> |
| 84 |
<?php do_action('fluent_community/portal_footer'); ?> |
| 85 |
<?php !$isHeadless && wp_footer(); ?> |
| 86 |
</body> |
| 87 |
</html> |
| 88 |
|