Skip to content

Instantly share code, notes, and snippets.

View ofyalcin's full-sized avatar
🎯
Focusing

Ömer Faruk ofyalcin

🎯
Focusing
View GitHub Profile
@ofyalcin
ofyalcin / redirects.txt
Last active June 24, 2017 13:41
/tavsiye/redirects.txt (detaylı anlatım: https://blogkurdu.net/wordpress-referans-link-yonlendirme/)
default,https://blogkurdu.net/tavsiyelerim
do,https://m.do.co/c/fe093887434f
deneme,https://wordpresshizmetleri.net/ben-kimim
digerlink,https://google.com
<?php
$id = isset( $_GET['id'] ) ? rtrim( trim( $_GET['id'] ), '/' ) : 'default';
$f = fopen( 'redirects.txt', 'r' );
$urls = array();
if ( !$f ) {
echo 'Yönlendirmeler için bir txt dosyası oluşturduğunuzdan emin olun.';
die;
}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@ofyalcin
ofyalcin / functions
Created December 26, 2016 20:57
Wordpress javascript dosyalarını footera taşıma kodu. Detaylı bilgi için https://blogkurdu.net/javascript-dosyalarini-footera-tasimak-wordpress/ adresini ziyaret edin.
// Version parametresini kaldır kodu başlangıcı
function vc_remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
// Version parametresini kaldır kodu sonu
@ofyalcin
ofyalcin / functions
Created December 26, 2016 20:55
Wordpress versiyon numaralarını kaldırma kodu. Detaylı bilgi için https://blogkurdu.net/javascript-dosyalarini-footera-tasimak-wordpress/ adresini ziyaret edin.
// Version parametresini kaldır kodu başlangıcı
function vc_remove_wp_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
@ofyalcin
ofyalcin / functions
Created December 26, 2016 20:52
Wordpress javascript dosyalarını footera taşıma kodu. Detaylı bilgi için https://blogkurdu.net/javascript-dosyalarini-footera-tasimak-wordpress/ adresini ziyaret edin.
// JS dosyalarını footera taşıma kodu başlangıcı.
function remove_head_scripts() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5); }
add_action( 'wp_enqueue_scripts', 'remove_head_scripts' );
// JS dosyalarını footera taşıma kodu sonu.
@ofyalcin
ofyalcin / 404.php
Last active December 26, 2016 22:58
Wordpress hata sayfalarını anasayfaya yönlendirme kodu. Daha fazla detay ve bilgi: https://blogkurdu.net/wordpess-404-hata-sayfalarini-anasayfaya-yonlendirme/
<?php header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>