Last active
July 5, 2023 11:13
-
-
Save buraksahin59/8889acd94649486dddc7d7fc8104d8f9 to your computer and use it in GitHub Desktop.
WordPress Kategori Linkini Kaldırma. Detaylı anlatım için temapazari.com'u ziyaret edin: https://temapazari.com/blog/wordpress-kategori-linkini-kaldirma-5-yontem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... Üst bölümde functions.php'deki kodlarınız yer alıyor | |
function temapazari_remove_category( $string, $type ) { | |
if ( $type != 'single' && $type == 'category' && ( strpos( $string, 'category' ) !== false ) ) { | |
$url_without_category = str_replace( "/category/", "/", $string ); | |
return trailingslashit( $url_without_category ); | |
} | |
return $string; | |
} | |
add_filter( 'user_trailingslashit', 'temapazari_remove_category', 100, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment