'', 'pagination' => '' ]; } return $res; } $payload = get_page_payload_from_loader($page); $listHtml = $payload['data']; $paginationHtml = $payload['pagination']; /* Build canonical/prev/next */ $base = 'https://sitharsastrology.com/blog/'; $canon = $page > 1 ? $base.'?page='.$page : $base; /* Extract prev/next from pagination (optional): if your load_blogs knows total pages, you can compute $prev/$next in PHP. For now we derive simple prev/next. */ preg_match_all('/data-page="(\d+)"/', $paginationHtml, $m); $pagesInPager = array_map('intval', $m[1]); $maxInPager = $pagesInPager ? max($pagesInPager) : $page; $minInPager = $pagesInPager ? min($pagesInPager) : 1; $prev = ($page > 1) ? $base . ($page-1 > 1 ? '?page='.($page-1) : '') : null; /* crude guess for next: if pager shows a higher number than current, enable next */ $next = ($maxInPager > $page) ? $base.'?page='.($page+1) : null; ?> <?php // Stronger title on paginated pages $siteTitle = getwebname("titles"); // echoes? If it echoes, you can replace with a fixed string. $tagline = gettagline("titles"); echo ($page>1) ? "All Blog Posts – Page $page | Sithars Astrology" : "Vedic Astrology Blog – Latest Articles & Guides | Sithars Astrology"; ?>