Ajax load more posts button

1) You should really use a separate JS file. 2) Check this guide: https://premium.wpmudev.org/blog/using-ajax-with-wordpress/

Can a scrollable date picker be done in WordPress for archives?

I’m going to leave the JavaScript/jQuery of the scroller up to you. But basically, run a loop of dates in that scroller. Then, when clicked, pass that date via AJAX to the server. Then use that date to query_posts, which you then return and insert into your dom. Use http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ for the AJAX functionality. I … Read more

AJAX function needed (toggle text) [closed]

I do not think you need any AJAX here, You can do this also using jQuery Slide method. http://docs.jquery.com/UI/Effects/Slide Try here http://www.w3schools.com/jquery/jquery_slide.asp http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_slide_down

A refreshless WordPress website

First there is bit of a snag in your terminology – “responsive” nowadays primarily refers to sites that adapt to screen sizes and is mostly unrelated to dynamically loaded content. WordPress is not natively engineered for Ajax themes. It is of course possible and people do create such, but as percentage of overall theme building … Read more

How To Pass Ajax Value to PHP Query?

Create simple functions like function func_for_ajax(){ wp_localize_script( ‘ajax_custom_script’, ‘frontendajax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); echo “simple demo ajax”; } Than create your ajax pass in wordpress action threw this function name directly. jQuery.ajax({ type: “POST”, action: ‘func_for_ajax’, url: ‘ajaxurl’, success: function(data){ jQuery(‘#content2’).html(data); } });

WooCommerce AJAX cross domain add to cart

If you have enabled the CORS policy headers then you can directly add a product via link given below; Site-url.com/?add-to-cart=PRO-ID&variation_id=ATTR-ID&quantity=1&attribute_YOUR-ATTR-NAME=ATTR-VALUE Trigger this url for an ajax / windows location on an action in your javascript.

using ajax to query sql

See documentation WordPress have admin-ajax.php file in wp-includes/ folder. Put in your data parametr action and create hooks: add_action(‘wp_ajax_{your_action}’, ‘handler’); add_action(‘wp_ajax_nopriv_{your_action}’, ‘handler’); ajax.url parametr you can get by using wp_localize_script(‘YOUR SCRIPT handle’, ‘ajax’, array(‘url’=> admin_url(‘admin-ajax.php’))) All code must looks like: add_action( ‘wp_enqueue_scripts’, ‘callback_for_setting_up_scripts’ ); function callback_for_setting_up_scripts() { wp_register_style( ‘mein-plugin’, plugins_url( ‘style.css’, __FILE__ ) ); wp_enqueue_style( … Read more