merhabalar bilindigi uzere wordpress te resim sitemapte 1000 adet link var fakat benim 1800 civari resmim var kullandigim kodla 1000 tanesini gosterebiliyorum fakat bunu ben nasil 2 sitemap sekilde yapabilirim
yani sayfa seklindeher 1000 etiket 1 sayfaya gelicek sekilde ?
<?php
include('wp-config.php');
include('wp-load.php');
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
$args = array( 'numberposts' => '1000' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
if($images = get_children(array(
'post_parent' => $recent["ID"],
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_mime_type' => 'image',
))) {
foreach($images as $image) {
$atturl = wp_get_attachment_url($image->ID);
$attlink = get_attachment_link($image->ID);
echo"rn <url>rn ";
echo"<loc>";
echo $attlink;
echo "</loc>rn ";
echo "<image:image>rn ";
echo "<image:loc>";
echo $atturl;
echo "</image:loc>rn ";
echo "</image:image>rn ";
echo "</url>";
}
}
}
echo"rn </urlset>";
?>