<?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.