// Membuat Shortcode [url_populer_harian] untuk digunakan di dalam kode HTML Widget
add_shortcode('url_populer_harian', 'get_daily_popular_post_url');
function get_daily_popular_post_url() {
    if (class_exists('\WordPressPopularPosts\Query')) {
        $query_args = array(
            'limit' => 1,
            'range' => 'daily', 
            'post_type' => 'post'
        );
        $popular_posts = new \WordPressPopularPosts\Query($query_args);
        $posts = $popular_posts->get_posts();
        if (!empty($posts)) {
            $first_post = is_array($posts) ? reset($posts) : $posts;
            return get_permalink($first_post->id);
        }
    }
    // Jika data kosong, kembali ke beranda sebagai cadangan aman
    return home_url('/'); 
}
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//digitalpanduan.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://digitalpanduan.com/post-sitemap.xml</loc>
		<lastmod>2026-06-19T09:00:45+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://digitalpanduan.com/page-sitemap.xml</loc>
		<lastmod>2026-06-19T08:35:42+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://digitalpanduan.com/category-sitemap.xml</loc>
		<lastmod>2026-06-19T09:00:45+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://digitalpanduan.com/author-sitemap.xml</loc>
		<lastmod>2026-06-19T17:00:45+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->