/**
* Template Name: TrafficInsider Premium Portal
* Description: A premium, ultra-fast, single-page listing template that auto-fetches WordPress posts natively.
*/if (!defined(‘ABSPATH’)) exit; // Exit if accessed directly
// Fetch active posts directly from WordPress Database
$posts_query = new WP_Query(array(
‘post_type’ => ‘post’,
‘posts_per_page’ => 12,
‘post_status’ => ‘publish’
));
$js_posts_data = array();
$first_post = null;
if ($posts_query->have_posts()) {
$counter = 0;
while ($posts_query->have_posts()) {
$posts_query->the_post();
// Setup categories safely
$categories = get_the_category();
$cat_name = !empty($categories) ? $categories[0]->name : ‘Yojana’;
// Extract post details
$post_data = array(
‘id’ => get_the_ID(),
‘title’ => get_the_title(),
‘category’ => $cat_name,
‘date’ => get_the_date(‘M d, Y’),
‘author’ => get_the_author(),
‘excerpt’ => wp_trim_words(get_the_excerpt(), 20, ‘…’),
‘content’ => apply_filters(‘the_content’, get_the_content())
);
$js_posts_data[] = $post_data;
if ($counter === 0) {
$first_post = $post_data;
}
$counter++;
}
wp_reset_postdata();
}
?>
<!DOCTYPE html>
<html lang=”hi-IN”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>TrafficInsider | 100% Verified Tech, Finance & Jobs Hub</title>
<!– Tailwind CSS CDN for high fidelity design styles –>
<script src=”https://cdn.tailwindcss.com“></script>
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css“>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
slateDark: ‘#0f172a‘,
emeraldBright: ‘#10b981‘,
emeraldDark: ‘#059669’,
}
}
}
}
</script>
</head>
<body class=”bg-slate-50 text-slate-800 flex flex-col min-h-screen font-sans”>
<!– 1. HEADER SECTION –>
<header class=”bg-white border-b border-slate-200 sticky top-0 z-50 shadow-sm”>
<div class=”max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between”>
<a href=”#” onclick=”resetToHome()” class=”flex items-center space-x-2 text-2xl font-extrabold text-slateDark tracking-tight”>
<span class=”bg-emeraldBright text-white p-1.5 rounded-lg”><i class=”fa-solid fa-bolt”></i></span>
<span>Traffic<span class=”text-emeraldBright”>Insider</span></span>
</a>
<span class=”text-xs bg-emeraldBright/10 text-emeraldBright font-bold px-3 py-1 rounded-full border border-emeraldBright/20″>
Native Live Connection
</span>
</div>
</header>
<!– 2. BRAND HERO BANNER –>
<section class=”bg-slateDark text-white py-12 px-4 text-center relative overflow-hidden”>
<div class=”max-w-4xl mx-auto relative z-10″>
<span class=”bg-emeraldBright/20 text-emeraldBright text-xs font-bold uppercase tracking-widest px-3 py-1 rounded-full”>Official Portal</span>
<h1 class=”text-3xl md:text-5xl font-extrabold mt-4 tracking-tight leading-tight”>
Always Stay Updated With <span class=”text-emeraldBright”>TrafficInsider</span>
</h1>
<p class=”text-slate-300 text-sm md:text-base mt-3 max-w-2xl mx-auto”>
Real-time technical specs, Government Welfare scheme checklists, and verified job notifications natively loaded.
Share on WhatsApp
WhatsApp Messenger: More than 2 billion people
in over 180 countries use WhatsApp to stay in touch with friends and
family, anytime and anywhere. What…
</p>
<!– Live filter search box –>
<div class=”max-w-md mx-auto mt-6 relative”>
<span class=”absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400″>
<i class=”fa-solid fa-magnifying-glass”></i>
</span>
<input type=”text” id=”search-bar” oninput=”handleSearch()” class=”w-full pl-10 pr-4 py-3 bg-slate-800 border border-slate-700 rounded-xl text-white placeholder-slate-400 focus:outline-none focus:border-emeraldBright shadow-lg text-sm” placeholder=”Search latest posts…”>
</div>
</div>
</section>
<!– 3. CATEGORY NAV TABS –>
<div class=”bg-white border-b border-slate-200 shadow-sm sticky top-16 z-40″>
<div class=”max-w-7xl mx-auto px-4 flex space-x-2 py-3 overflow-x-auto scrollbar-none”>
<button onclick=”filterCategory(‘All’)” class=”cat-tab active px-4 py-2 bg-slateDark text-white rounded-full text-xs font-semibold transition whitespace-nowrap”>All Feeds</button>
<button onclick=”filterCategory(‘Tech’)” class=”cat-tab px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-full text-xs font-semibold transition whitespace-nowrap”>
Tech Reviews</button>
<button onclick=”filterCategory(‘Yojana’)” class=”cat-tab px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-full text-xs font-semibold transition whitespace-nowrap”>
Sarkari Yojana</button>
<button onclick=”filterCategory(‘Jobs’)” class=”cat-tab px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-full text-xs font-semibold transition whitespace-nowrap”>
Job Alerts</button>
<button onclick=”filterCategory(‘Finance’)” class=”cat-tab px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-full text-xs font-semibold transition whitespace-nowrap”>
Personal Finance</button>
</div>
</div>
<!– 4. CORE GRID SYSTEM –>
<div class=”max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 flex-grow w-full”>
<div class=”grid grid-cols-1 lg:grid-cols-3 gap-8″>
<!– LEFT: MAIN CONTENT AREA (70%) –>
<main class=”lg:col-span-2″>
<!– i. Home Listing Feed –>
<section id=”home-view” class=”block”>
<h2 class=”text-xl font-extrabold text-slateDark mb-6 flex items-center gap-2″>
<span class=”w-3 h-6 bg-emeraldBright rounded-full”></span> Latest Dynamic Publications
</h2>
<div id=”posts-grid” class=”grid grid-cols-1 md:grid-cols-2 gap-6″>
<!– Loaded smoothly via local JavaScript array parsed from PHP –>
</div>
<div id=”no-results” class=”hidden text-center py-12″>
<i class=”fa-solid fa-file-circle-exclamation text-slate-300 text-5xl mb-3″></i>
<p class=”text-slate-500 font-semibold”>Koi post nahi mili. Dobara search kijiye!</p>
</div>
</section>
<!– ii. Smooth Single Post Reader Viewport –>
<section id=”post-view” class=”hidden bg-white rounded-2xl p-6 border border-slate-200 shadow-sm”>
<button onclick=”showSection(‘home’)” class=”mb-6 inline-flex items-center gap-2 text-sm text-emeraldBright hover:text-emeraldDark font-bold”>
<i class=”fa-solid fa-arrow-left”></i> Back to Main Feed
</button>
<div id=”full-post-container”>
<!– Loaded instantly without reload lags –>
</div>
</section>
</main>
<aside class=”space-y-6″>
<!– AdSense Slot Placeholder –>
<div class=”bg-white rounded-2xl p-4 border border-slate-200 shadow-sm text-center”>
<p class=”text-[10px] text-slate-400 uppercase tracking-widest font-bold mb-2″>Google AdSense Placement Slot</p>
<div class=”bg-slate-100 border border-dashed border-slate-300 rounded-lg py-12 flex flex-col items-center justify-center”>
<i class=”fa-solid fa-rectangle-ad text-slate-400 text-3xl mb-1″></i>
<span class=”text-xs text-slate-400 font-medium”>Automatic Responsive Ads</span>
</div>
</div><!– Trending lists widgets –>
<div class=”bg-white rounded-2xl p-5 border border-slate-200 shadow-sm”>
<h3 class=”font-extrabold text-slateDark text-md mb-4 flex items-center gap-2″>
<i class=”fa-solid fa-bolt text-amber-500″></i> Trending Updates Today
</h3>
<ul class=”space-y-3″ id=”trending-list”>
<!– Loaded dynamically –>
</ul>
</div>
<!– Newsletter Subscription Card –>
<div class=”bg-slateDark text-white rounded-2xl p-5 shadow-lg relative overflow-hidden”>
<h3 class=”font-extrabold text-md mb-2″>Subscribe to TrafficInsider</h3>
<p class=”text-xs text-slate-300 mb-4 leading-relaxed”>Ek bhi critical alert update miss na karein. Nayi sarkari naukri aur schemes seedhe apne inbox par payein.</p>
<form onsubmit=”handleSubscribe(event)” class=”space-y-2″>
<input type=”email” required class=”w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white placeholder-slate-400 focus:outline-none focus:border-emeraldBright” placeholder=”Enter your email…”>
<button class=”w-full bg-emeraldBright hover:bg-emeraldDark transition text-white text-xs font-bold py-2 rounded-lg”>Subscribe Now</button>
</form>
</div>
</aside>
</div>
</div>
<!– 5. FOOTER WITH INTEGRATED LEGAL ACCORDIONS (100% WORKING) –>
<footer class=”bg-slateDark text-slate-400 pt-12 pb-6 px-4 border-t-4 border-emeraldBright mt-auto”>
<div class=”max-w-7xl mx-auto text-center space-y-6″>
<!– Safe Toggles –>
<div class=”flex justify-center space-x-6 text-xs font-bold text-slate-300″>
<button onclick=”toggleLegalTab(‘about-panel’)” class=”hover:text-emeraldBright transition”>About Us</button>
<button onclick=”toggleLegalTab(‘privacy-panel’)” class=”hover:text-emeraldBright transition”>Privacy Policy</button>
<button onclick=”toggleLegalTab(‘terms-panel’)” class=”hover:text-emeraldBright transition”>Terms of Service</button>
</div>
<!– Accordion Drawers –>
<div class=”max-w-3xl mx-auto text-left”>
<!– About panel –>
<div id=”about-panel” class=”hidden bg-slate-800 p-5 rounded-lg border border-slate-700 text-slate-300 text-xs mb-4″>
<h4 class=”text-white font-bold mb-2 text-sm”>About TrafficInsider</h4>
<p class=”leading-relaxed”>Welcome to <strong>TrafficInsider</strong> (2026). Hum ek premium authoritative updates aur tech news channel hain. Hamara maqsad bilkul simple language me dynamic criteria checklists, real reviews, aur verified eligibility data bina kisi server lag ke readers tak pahunchana hai.</p>
</div>
<div id=”privacy-panel” class=”hidden bg-slate-800 p-5 rounded-lg border border-slate-700 text-slate-300 text-xs mb-4″>
<h4 class=”text-white font-bold mb-2 text-sm”>Privacy Policy Guidelines</h4>
<p class=”leading-relaxed”>TrafficInsider website user privacy ka poora khayal rakhti hai. Hum apni website par koi sensitive variables ya cookie data trace nahi karte. Hamari advertising standards standard Google programmatic partner rules follow karti hain.</p>
</div><!– Terms of Service –>
<div id=”terms-panel” class=”hidden bg-slate-800 p-5 rounded-lg border border-slate-700 text-slate-300 text-xs mb-4″>
<h4 class=”text-white font-bold mb-2 text-sm”>Terms of Service</h4>
<p class=”leading-relaxed”>TrafficInsider par published sabhi posts, guidelines, aur parameters direct official releases aur checklists par researched hote hain. Halaanki hum complete verification ki koshish karte hain, par users ko paramarsh hai ki official portal check zaroor karein.</p>
</div>
</div>
<div class=”text-xs text-slate-500″>
© 2026 TrafficInsider Core Engine. Developed under strict AdSense E-E-A-T Compliance Rules.
</div>
</div>
</footer>
<!– ENGINE CODE LOGIC –>
<script>
// Inject WordPress Database posts dynamically into safe local client JS array
const posts = <?php echo json_encode($js_posts_data); ?>;
let currentCategory = ‘All’;
window.addEventListener(‘DOMContentLoaded’, () => {
if (posts.length === 0) {
// Show notice if no posts exist in WP DB yet
document.getElementById(‘no-results’).classList.remove(‘hidden’);
} else {
renderPosts();
renderTrendingTickers();
}
});
// Search engine filters native arrays
function handleSearch() {
showSection(‘home’);
renderPosts();
}
// Filters categories
function filterCategory(cat) {
currentCategory = cat;
document.querySelectorAll(‘.cat-tab’).forEach(tab => {
tab.className = “cat-tab px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-full text-xs font-semibold transition whitespace-nowrap”;
});
const activeTab = Array.from(document.querySelectorAll(‘.cat-tab’)).find(tab => tab.textContent.includes(cat) || (cat === ‘All’ && tab.textContent.includes(‘All’)));
if (activeTab) {
activeTab.className = “cat-tab active px-4 py-2 bg-slateDark text-white rounded-full text-xs font-semibold transition whitespace-nowrap”;
}
showSection(‘home’);
renderPosts();
}
// Render card feeds
function renderPosts() {
const grid = document.getElementById(‘posts-grid’);
const noResults = document.getElementById(‘no-results’);
if (!grid) return;
grid.innerHTML = ”;
const filtered = posts.filter(post => {
const matchesCategory = (currentCategory === ‘All’ || post.category === currentCategory);
const query = document.getElementById(‘search-bar’).value.toLowerCase();
const matchesSearch = post.title.toLowerCase().includes(query) || post.excerpt.toLowerCase().includes(query);
return matchesCategory && matchesSearch;
});
if (filtered.length === 0) {
noResults.classList.remove(‘hidden’);
} else {
noResults.classList.add(‘hidden’);
grid.classList.remove(‘hidden’);filtered.forEach(post => {
const card = document.createElement(‘div’);
card.className = “bg-white border border-slate-200 rounded-xl p-5 hover:shadow-md transition cursor-pointer flex flex-col justify-between shadow-sm”;
card.setAttribute(‘onclick’,
openFullPost('${post.id}'));
let badgeColor = “bg-slate-100 text-slate-700”;
if (post.category === ‘Tech’) badgeColor = “bg-purple-100 text-purple-700”;
if (post.category === ‘Yojana’) badgeColor = “bg-amber-100 text-amber-700”;
if (post.category === ‘Jobs’) badgeColor = “bg-blue-100 text-blue-700”;
if (post.category === ‘Finance’) badgeColor = “bg-emerald-100 text-emerald-700”;
card.innerHTML = ;
<div>
<div class="flex items-center justify-between mb-3">
<span class="px-2.5 py-1 rounded-full text-[10px] font-bold uppercase tracking-wider ${badgeColor}">${post.category}</span>
<span class="text-xs text-slate-400">${post.date}</span>
</div>
<h3 class="font-extrabold text-slateDark text-base md:text-lg mb-2 hover:text-emeraldBright transition leading-snug">${post.title}</h3>
<p class="text-xs text-slate-500 leading-relaxed mb-4">${post.excerpt}</p>
</div>
<div class="flex items-center justify-between pt-3 border-t border-slate-100">
<span class="text-[11px] font-medium text-slate-400"><i class="fa-solid fa-user-pen mr-1"></i> ${post.author}</span>
<span class="text-xs text-emeraldBright font-bold flex items-center gap-1">Read Update <i class="fa-solid fa-arrow-right text-[10px]"></i></span>
</div>
grid.appendChild(card);
});
}
}
// Dynamic viewport viewer rendering
function openFullPost(id) {
const post = posts.find(p => p.id === id.toString());
if (!post) return;
const target = document.getElementById(‘full-post-container’);
if (!target) return;
const postURL = encodeURIComponent(window.location.origin + window.location.pathname + “#” + post.id);
const postTitle = encodeURIComponent(post.title);
target.innerHTML = `
<div class=”post-header border-b border-slate-100 pb-4 mb-6″>
<div class=”flex items-center gap-2 mb-2″>
<span class=”px-2.5 py-1 bg-slate-900 text-white rounded-full text-[10px] font-bold uppercase tracking-wider”>${post.category}</span>
<span class=”text-xs text-slate-400″>${post.date}</span>
</div>
<h1 class=”text-2xl md:text-3xl font-extrabold text-slateDark tracking-tight leading-tight”>${post.title}</h1>
<p class=”text-xs text-slate-400 mt-2″>Verified and published by: <strong>${post.author}</strong></p>
</div>
<div class=”post-body text-slate-700 leading-relaxed text-sm md:text-base space-y-4″>
${post.content}
</div>
<!– Instant social share buttons –>
<div class=”share-container border-t border-dashed border-slate-200 pt-6 mt-8″>
Share This Update:</p><a href=”https://www.facebook.com/sharer/sharer.php?u=${postURL}” target=”_blank” class=”inline-block bg-[#1877F2] text-white px-4 py-2 rounded text-xs font-bold mr-2 transition hover:opacity-90″><i class=”fa-brands fa-facebook-f mr-1″></i> Facebook</a>
<a href=”https://api.whatsapp.com/send?text=${postTitle}%20${postURL}” target=”_blank” class=”inline-block bg-[#25D366] text-white px-4 py-2 rounded text-xs font-bold mr-2 transition hover:opacity-90″><i class=”fa-brands fa-whatsapp mr-1″></i> WhatsApp</a>
<button class=”bg-slate-100 text-slate-700 px-4 py-2 rounded text-xs font-bold transition hover:bg-slate-200″ onclick=”copyPostLink()”><i class=”fa-solid fa-link mr-1″></i> Copy Link</button>
</div><!– Authors EEAT Profiles Box –>
<div class=”author-box bg-slate-50 border border-slate-200 rounded-xl p-5 mt-8 flex items-center space-x-4″>
<div class=”w-12 h-12 rounded-full bg-emeraldBright text-white font-bold flex items-center justify-center text-lg flex-shrink-0″>TI</div>
<div>
<h4 class=”font-bold text-slateDark text-sm”>Written by ${post.author}</h4>
<p class=”text-xs text-slate-500 mt-1″>Official content editorial desk. We monitor, cross-verify, and publish technical reviews, job notifications, and central welfare scheme parameters under strict verification guidelines.</p>
</div>
</div>
;
showSection(‘post’);
}
// Section views router
function showSection(section) {
const homeView = document.getElementById(‘home-view’);
const postView = document.getElementById(‘post-view’);
if (section === ‘home’) {
homeView.classList.remove(‘hidden’);
postView.classList.add(‘hidden’);
window.scrollTo({ top: 320, behavior: ‘smooth’ });
} else {
homeView.classList.add(‘hidden’);
postView.classList.remove(‘hidden’);
window.scrollTo({ top: 320, behavior: ‘smooth’ });
}
}
// Footer Legal Drawer Toggles
function toggleLegalTab(panelId) {
const panel = document.getElementById(panelId);
if (!panel) return;
const isHidden = panel.classList.contains(‘hidden’);
// Safe Close all first to prevent stack overlays
document.getElementById(‘about-panel’).classList.add(‘hidden’);
document.getElementById(‘privacy-panel’).classList.add(‘hidden’);
document.getElementById(‘terms-panel’).classList.add(‘hidden’);
if (isHidden) {
panel.classList.remove(‘hidden’);
panel.scrollIntoView({ behavior: ‘smooth’ });
}
}
function renderTrendingTickers() {
const target = document.getElementById(‘trending-list’);
if(!target) return;
target.innerHTML = ”;
posts.slice(0, 3).forEach(post => {
const li = document.createElement(‘li’);
li.className = “border-b border-slate-100 pb-2 cursor-pointer group”;
li.setAttribute(‘onclick’, openFullPost(‘${post.id}’));
li.innerHTML =
<span class=”text-[10px] font-bold text-emeraldBright block uppercase”>${post.category}</span>
<p class=”text-xs text-slate-700 font-bold group-hover:text-emeraldBright transition leading-tight”>${post.title}</p>
`;
target.appendChild(li);
});
}
function resetToHome() {
showSection(‘home’);
filterCategory(‘All’);
}
const dummyUrl = window.location.href;
const input = document.createElement(‘input’);
input.value = dummyUrl;
document.body.appendChild(input);
input.select();try {
document.execCommand(‘copy’);
alert(“URL successfully copied to clipboard!”);
} catch (err) {
console.error(“Copy failed”);
}
document.body.removeChild(input);
}
function handleSubscribe(e) {
e.preventDefault();
alert(‘Aap TrafficInsider alert list me register ho chuke hain!’);
e.target.reset();
}
</script>
</body>
</html>