



// Register custom pagination shortcode
function custom_pagination_shortcode() {
    global $page, $numpages, $multipage;
    
    if (!$multipage) {
        return '<p style="color:red;">⚠️ Pagination not available. Add <!--nextpage--> in your post.</p>';
    }
    
    $output = '<div class="custom-pagination-wrapper">';
    $output .= '<div class="pagination-pages">';
    
    // Page indicator
    $output .= '<span class="page-indicator">📄 Page ' . $page . ' of ' . $numpages . '</span>';
    
    // Previous page link
    if ($page > 1) {
        $prev = $page - 1;
        $output .= '<a href="' . get_permalink() . ($prev > 1 ? $prev : '') . '" class="pagination-prev">← Previous</a>';
    } else {
        $output .= '<span class="pagination-prev disabled">← Previous</span>';
    }
    
    // Next page link
    if ($page < $numpages) {
        $next = $page + 1;
        $output .= '<a href="' . get_permalink() . ($next > 1 ? $next : '') . '" class="pagination-next">Next →</a>';
    } else {
        $output .= '<span class="pagination-next disabled">Next →</span>';
    }
    
    $output .= '</div>';
    $output .= '</div>';
    
    return $output;
}
add_shortcode('custom_pagination', 'custom_pagination_shortcode');

// Process <!--nextpage--> tags
function process_custom_pagination($content) {
    if (is_single() || is_page()) {
        $content = str_replace('<!--nextpage-->', '', $content);
    }
    return $content;
}
add_filter('the_content', 'process_custom_pagination', 1);

// Add rel="prev" and rel="next" for SEO
function custom_pagination_rel_links() {
    if (is_single() || is_page()) {
        global $page, $numpages;
        
        if ($page > 1) {
            $prev = $page - 1;
            echo '<link rel="prev" href="' . get_permalink() . ($prev > 1 ? $prev : '') . '" />' . "\n";
        }
        if ($page < $numpages) {
            $next = $page + 1;
            echo '<link rel="next" href="' . get_permalink() . ($next > 1 ? $next : '') . '" />' . "\n";
        }
    }
}
add_action('wp_head', 'custom_pagination_rel_links');

// Page break shortcode
function page_break_shortcode() {
    return '<!--nextpage-->';
}
add_shortcode('page_break', 'page_break_shortcode');

// Enable pagination for pages
function enable_pagination_for_pages() {
    global $multipage;
    $multipage = 1;
}
add_action('wp', 'enable_pagination_for_pages');
?>



<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//yellismart.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://yellismart.com/post-sitemap.xml</loc>
		<lastmod>2026-06-08T14:30:54+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://yellismart.com/page-sitemap.xml</loc>
		<lastmod>2026-06-09T15:45:56+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://yellismart.com/category-sitemap.xml</loc>
		<lastmod>2026-06-08T14:30:54+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->