bir kaç eklenti plugin vs bakındım ama bana fonksiyonel gelmedi
resimlerinizi galeri gibi ayrı sayfalarda görüntülediğiniz bir siteniz varsa bu işinizi görecektir
kendim için yazdım vatandaş yararlansın
<?php
include('wp-config.php');
header("Content-type: text/xml\n\n");
echo"<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">";
?>
<?php
$imal=mysql_query("select * from wp_postmeta where meta_key='_wp_attached_file' order by meta_id DESC LIMIT 5000");
while ( $ver = mysql_fetch_array($imal) )
{
$imgurl=$ver['meta_value'];
$kid=$ver['post_id'];
?>
<url>
<loc>http://xxx.com/?attachment_id=<? echo $kid; ?></loc>
<image:image>
<image:loc>http://xxxx.com/wp-content/uploads/<? echo $imgurl; ?></image:loc>
</image:image>
</url>
<?
}
echo "</urlset>";
?>xxxx.com yerine sitenizi yazıp imagemap.php seklinde kaydedin ve wordpress kurulu ana dizine atın.
smye bile gerek yok benim şuan mübalağasız index almayan resmim yok
2 kıyak daha geçelim vatandaşa
wp upload ettiğiniz resimlerin medium boyu için sitemap
<?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' => '20' );
$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, // show all
'post_status' => null,
'post_mime_type' => 'image',
))) {
foreach($images as $image) {
$atturl = wp_get_attachment_medium_url($image->ID);
$attlink = get_attachment_link($image->ID);
$atttitle = apply_filters('the_title',$image->post_title);
echo"\r\n <url>\r\n ";
echo"<loc>";
echo $attlink;
echo "</loc>\r\n ";
echo "<image:image>\r\n ";
echo "<image:loc>";
echo $atturl;
echo "</image:loc>\r\n ";
echo "</image:image>\r\n ";
echo "</url>";
}
}
}
echo"\r\n </urlset>";
?>bu da thumbnail sitemap
<?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' => '20' );
$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, // show all
'post_status' => null,
'post_mime_type' => 'image',
))) {
foreach($images as $image) {
$atturl = wp_get_attachment_thumb_url($image->ID);
$attlink = get_attachment_link($image->ID);
$atttitle = apply_filters('the_title',$image->post_title);
echo"\r\n <url>\r\n ";
echo"<loc>";
echo $attlink;
echo "</loc>\r\n ";
echo "<image:image>\r\n ";
echo "<image:loc>";
echo $atturl;
echo "</image:loc>\r\n ";
echo "</image:image>\r\n ";
echo "</url>";
}
}
}
echo"\r\n </urlset>";
?>