-
Üyelik
22.01.2014
-
Yaş/Cinsiyet
25 / E
-
Meslek
Öğrenci
-
Konum
İzmir
-
Ad Soyad
C** K**
-
Mesajlar
6
-
Beğeniler
6 / 4
-
Ticaret
0, (%0)
Kodu js dosyasına kaydedip temanın functions.php dosyasından çağırabilirsin
JS dosyası çağırma örneği:
function wpdocs_scripts_method() {
wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/custom_script.js', array( 'jquery' ) );
}
1 kişi bu mesajı beğendi.
-
Üyelik
22.01.2014
-
Yaş/Cinsiyet
25 / E
-
Meslek
Öğrenci
-
Konum
İzmir
-
Ad Soyad
C** K**
-
Mesajlar
6
-
Beğeniler
6 / 4
-
Ticaret
0, (%0)
Öncelikle bu kod icon-download class'ını etkilediğinden sayfanın olabildiğince altına ekle. Kod icon-download class'ından sonra yüklenmiş olur.
Hala kod çalışmıyorsa;
ftpden tema dizinine gir. (wp-content/themes içinde)
çalıştıracağın kodu bir js dosyasına kaydet. örneğin js klasörü içine code.js ismiyle.
sonra tema klasörün içindeki functions.php dosyasını aç kodların sonuna
function isma3ilo_scripts() {
wp_enqueue_script( 'isma3ilo-code', get_template_directory_uri() . '/js/code.js');
}
add_action( 'wp_enqueue_scripts', 'isma3ilo_scripts' );
bu kodu ekle. Dosya ismi ve konumu değişirse kodda düzenlemeyi unutma
1 kişi bu mesajı beğendi.