Ajax: Unterschied zwischen den Versionen
Flinh1 (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „ ---- * [https://premium.wpmudev.org/blog/using-ajax-with-wordpress/ Using Ajax with Wordpress] <nowiki> add_action( 'wp_enqueue_scripts', 'ajax_test_enq…“) |
Flinh1 (Diskussion | Beiträge) |
||
Zeile 4: | Zeile 4: | ||
---- | ---- | ||
+ | == Ajax in WordPress == | ||
* [https://premium.wpmudev.org/blog/using-ajax-with-wordpress/ Using Ajax with Wordpress] | * [https://premium.wpmudev.org/blog/using-ajax-with-wordpress/ Using Ajax with Wordpress] |
Version vom 24. Oktober 2018, 07:51 Uhr
Ajax in WordPress
add_action( 'wp_enqueue_scripts', 'ajax_test_enqueue_scripts' ); function ajax_test_enqueue_scripts() { if( is_single() ) { wp_enqueue_style( 'love', plugins_url( '/love.css', __FILE__ ) ); } wp_enqueue_script( 'love', plugins_url( '/love.js', __FILE__ ), array('jquery'), '1.0', true ); wp_localize_script( 'love', 'postlove', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) )); }
- https://premium.wpmudev.org/blog/using-ajax-with-wordpress/ Using Ajax with Wordpress