wordpress

add custom post type in wordpress

  /* * Creating a function to create our CPT */ function custom_post_type() { // Set UI labels for Custom Post Type $labels = array( ‘name’ => _x( ‘Movies’, ‘Post Type General Name’, ‘twentytwenty’ ), ‘singular_name’ => _x( ‘Movie’, ‘Post Type Singular Name’, ‘twentytwenty’ ), ‘menu_name’ => __( ‘Movies’, ‘twentytwenty’ ), ‘parent_item_colon’ => __( ‘Parent …

add custom post type in wordpress Read More »

add ajax url in wordpress

function dbk_enqueue_scripts() { wp_enqueue_script( ‘debugger_custom_js’, plugins_url( ‘js/debugger-kanha.js’, __FILE__ ), array() ); //load jquery wp_enqueue_script( ‘jquery’ ); //add ajax url wp_localize_script( ‘debugger_custom_js’, ‘dbk’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); } add_action( ‘admin_enqueue_scripts’, ‘dbk_enqueue_scripts’ ); //for ajax call add_action( ‘wp_ajax_dbk_ajax’, ‘dbk_ajax_subscribe’ ); output function function dbk_ajax_subscribe(){ echo ‘this is ajax subscribe form’; } <script> jQuery(document).ready(function() { // …

add ajax url in wordpress Read More »