• 26-11-2016, 11:25:27
    #1
    Arkadaşlar merhaba wordpress ortam dosyasını sayfalandırma yapıldı ama linki aşağıdaki gibi çıkıyor ''attachment'' bölümünü nasıl kaldırabilirim?
    www.site.com/kategori/attachment/resim-ismi
  • 29-11-2016, 08:53:26
    #2
    güncel arkadaşlar yardımcı olacak varmı
  • 29-11-2016, 09:13:05
    #3
    <?php
    add_filter( 'attachment_link', 'attachment_paint', 20, 2 );
    function attachment_paint( $link, $attachment_id ){
        $attachment = get_post( $attachment_id );
        if( ! empty( $attachment->post_parent ) ) {
            $parent_link = get_permalink( $attachment->post_parent );
            $parent_link = rtrim( $parent_link, "/" );
            $link =  $parent_link . '/resim/' . $attachment_id;
        }
        return $link;
    }
    add_action( 'init', function() {
        add_rewrite_rule( '(.+)/resim/([0-9]{1,})/?$', 'index.php?attachment_id=$matches[2]', 'top' );
    } );
    ?>
    Daha önce denemedim. wp-content/themes/tema-adi/functions.php içine yazıp deneyin olumlu yada olumsuz dönüş yaparsan sevinirim. Kolay Gelsin.
  • 25-01-2017, 22:05:57
    #4
    aynı sorunu bende yaşıyorum galiba tema ile alakalı bir durum değil ama çözemedim
  • 26-01-2017, 15:49:31
    #6
    bu ne tür sorunlara yol açıyor ?