Loads posts of different year via AJAX call

To Ajaxify the request you need two parts, a php function, hooked to the wp_admin_ajax ( and the wp_admin_ajax_nopriv if you want it to be available for non logged in user) and a JavaScript to request the AJAX. PHP add_action(‘wp_ajax_getpost_by_year’,’process_getpost_by_year’); add_action(‘wp_ajax_nopriv_getpost_by_year’,’process_getpost_by_year’); function process_getpost_by_year(){ $year = $_REQUEST[‘year’]; $args = array( ‘post_type’ => ‘post’, ‘ignore_sticky_posts’ => 1, … Read more

Ajax takes 10x as long as it should/could

Yep, this is nasty issue that to have full WordPress environment you need to spend considerable time loading it. I’ve needed much better performance (for very dynamic incremental search feature) for work and what I went with is: Custom file as Ajax handler. SHORTINIT constant for limited WP core load. Very selectively loaded parts of … Read more