Invoking Jquery in a Plugin

To load default wordpess jquery you can use this add_action( ‘wp_enqueue_scripts’, ‘my_jquery’ ); function my_jquery(){ wp_enqueue_script(“jquery”); } And use jquery no conflict wrapper to avoid error or on your jquery code (function($) { // Inside of this function, $() will work as an alias for jQuery() // and other libraries also using $ will not … Read more

Function won’t run onclick using Ajax

1) Is your function working? First do a console.log( “it’s working” ); inside your function and check it on your browser’s console. If it’s not showing when you click, you must refactor your function. 2) Have you defined ajaxurl? Unlike on the admin side, the ajaxurl javascript global does not get automatically defined for you, … Read more

Creating a new div onclick wordpress+ajax

To add action for WordPress AJAX If you needed to create an AJAX handler for an “render_admin_charts_page” request, you would create a hook like this: add_action( ‘wp_ajax_render_admin_charts_page’, ‘yourfunction’ ); function yourfunction() { ?> <div class=”wrap”> <div class=”em-bookings-events”> <h2><?php esc_html_e(‘Event Booking Report’,’dbem’); ?></h2> <?php em_bookings_events_table(); ?> </div> </div> <?php // Handle request then generate response using … Read more

Jquery was not found on this server

The proper way to include jquery in your plugin is /** * Proper way to enqueue scripts and styles */ function theme_name_scripts() { wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );

Flexslider won’t work on WordPress

It seems like you are following the tutorial from tutsplus “Slider to Your WordPress Theme” Coding looks correct but as @cybmeta already mentioned in the comment you need to set Featured Image for each slide to display in the slider properly. Details for Featured Image here also