🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 seo.php

📁 Path: /home/skhata/excellenteducation.com.np/includes/seo.php
📊 Size: 2.76 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
require_once __DIR__ . '/functions.php';

/**
 * Render <title>, meta description/keywords, canonical, Open Graph, Twitter Card,
 * and Organization JSON-LD schema. Call once inside each page's <head>.
 */
function render_seo(string $title = '', string $description = '', string $image = '', string $type = 'website'): void {
    $s = get_settings();
    $siteName = $s['site_name'] ?? 'Excellent Education & Counselling Services Pvt. Ltd.';

    $finalTitle = $title !== '' ? $title . ' | ' . $siteName : ($s['meta_title'] ?? $siteName);
    $finalDesc  = $description !== '' ? $description : ($s['meta_description'] ?? '');
    $finalImage = $image !== '' ? resolve_image($image) : resolve_image($s['og_image'] ?? '', SITE_URL . '/assets/img/logo-full.png');
    $canonical  = SITE_URL . ($_SERVER['REQUEST_URI'] ?? '/');

    echo '<title>' . e($finalTitle) . "</title>\n";
    echo '<meta name="description" content="' . e($finalDesc) . "\">\n";
    if (!empty($s['meta_keywords'])) {
        echo '<meta name="keywords" content="' . e($s['meta_keywords']) . "\">\n";
    }
    echo '<link rel="canonical" href="' . e($canonical) . "\">\n";

    echo '<meta property="og:site_name" content="' . e($siteName) . "\">\n";
    echo '<meta property="og:title" content="' . e($finalTitle) . "\">\n";
    echo '<meta property="og:description" content="' . e($finalDesc) . "\">\n";
    echo '<meta property="og:type" content="' . e($type) . "\">\n";
    echo '<meta property="og:url" content="' . e($canonical) . "\">\n";
    echo '<meta property="og:image" content="' . e($finalImage) . "\">\n";

    echo '<meta name="twitter:card" content="summary_large_image">' . "\n";
    echo '<meta name="twitter:title" content="' . e($finalTitle) . "\">\n";
    echo '<meta name="twitter:description" content="' . e($finalDesc) . "\">\n";
    echo '<meta name="twitter:image" content="' . e($finalImage) . "\">\n";

    echo '<link rel="icon" type="image/png" href="' . e(resolve_image($s['favicon'] ?? 'assets/img/logo-icon.png')) . "\">\n";

    $schema = [
        '@context' => 'https://schema.org',
        '@type' => 'EducationalOrganization',
        'name' => $siteName,
        'url' => SITE_URL,
        'logo' => resolve_image($s['logo_full'] ?? ''),
        'address' => [
            '@type' => 'PostalAddress',
            'streetAddress' => $s['address'] ?? '',
            'addressCountry' => 'NP',
        ],
        'telephone' => $s['phone'] ?? '',
        'email' => $s['email'] ?? '',
        'sameAs' => array_values(array_filter([
            $s['facebook_url'] ?? '', $s['instagram_url'] ?? '', $s['youtube_url'] ?? '', $s['linkedin_url'] ?? '',
        ], fn($u) => $u && $u !== '#')),
    ];
    echo '<script type="application/ld+json">' . json_encode($schema, JSON_UNESCAPED_SLASHES) . "</script>\n";
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨