• 11-05-2014, 17:42:17
    #1
    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.


    Misafir adlı üyeden alıntı: mesajı görüntüle
    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>";
    ?>
    • bondcemil
    • Avni
    • Yeniceri
    bondcemil, Avni, Yeniceri ve 5 kişi bunu beğendi.
    8 kişi bunu beğendi.
  • 14-05-2014, 04:16:50
    #2
    Gerçi alaka görmemiş konu ama yinede birilerinin işine yarar ilerde V2

    son 50 konuya ait tüm resimleri ve attachment urlleri harita yapalım

    <?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' => '50' );
        $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"\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>";
    ?>

    resim haritası max 1000 url içerebilir ona göre yukarıdaki 50 rakamını kendinize göre düzenleyebilirsiniz.
    • _TopraK_
    • SABOCES
    • Denizgil
    _TopraK_, SABOCES, Denizgil ve 1 kişi bunu beğendi.
    4 kişi bunu beğendi.
  • 05-12-2014, 22:56:32
    #3
    Üyeliği durduruldu
    Misafir adlı üyeden alıntı: mesajı görüntüle
    Gerçi alaka görmemiş konu ama yinede birilerinin işine yarar ilerde V2

    son 50 konuya ait tüm resimleri ve attachment urlleri harita yapalım

    <?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' => '50' );
        $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"\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>";
    ?>

    resim haritası max 1000 url içerebilir ona göre yukarıdaki 50 rakamını kendinize göre düzenleyebilirsiniz.
    Hocam kodlar bozuk çıkmıs rica etsem düzgün halini koyabilir misiniz?
  • 06-12-2014, 15:00:33
    #4
    pan_river adlı üyeden alıntı: mesajı görüntüle
    Hocam kodlar bozuk çıkmıs rica etsem düzgün halini koyabilir misiniz?
    <?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' => '50' );
        $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_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>";
    ?>
    • pan_river
    • trenderkek
    • SABOCES
    pan_river, trenderkek ve SABOCES bunu beğendi.
    3 kişi bunu beğendi.
  • 07-12-2014, 11:54:53
    #5
    Demo var mıdır?
  • 01-06-2015, 16:50:17
    #6
    Eline sağlık Misafir; alaka görüyor merak etme.
  • 16-09-2015, 12:20:34
    #7
    Tam olarak bu kodun yolu neresi Hocam?
    .xml
  • 25-02-2016, 20:25:45
    #8
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Resim haritasi haricinde normal sitemap de yazmak gerekirmi
  • 29-02-2016, 19:53:19
    #9
    teşekürler