Ajaxify calendar

Write your required javascript, then use this code to display it on the page, it ensures that the script is only included if the calendar is displayed add_filter(‘get_calendar’, ‘add_calendar_scripts’); function add_calendar_scripts($content) { add_action( ‘wp_footer’, ‘output_calendar_scripts’, 11); return $content; } function output_calendar_scripts() { ?> <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/70078/<?php echo get_template_directory_uri();?>/path/to/script.js”></script> <?php }

Update get_pages using ajax on form select change

Your Javascript is loading the whole page anyway, since you are sending a request to the_permalink. If you are going to do that just reload the page. First, your should be using the AJAX API. There are a couple of steps but it isn’t that hard. See the Codex to get started. In your callback … Read more

Ajax loading duplicate post

You have got a few things to consider here. Let’s start the way the Browser does. You build up the HTML, so far so good, containing the Structure and everything for your site. No articles are shown. The next step your Browser has to do is make the AJAX call. Here are the first things … Read more

admin-ajax.php ” Missing argument 2″ warning

Ajax-calls use the $_POST-variable to submit their arguments to the function. As $_POST[‘action’] is always used by WordPress Ajax calls (contains the name of the action, obviously 😉 ), PHP only complains over missing argument no. 2. You can either use the solution provided by Bainternet. If you want to use your function in ajax … Read more

Load more posts with multiple queries

Looks like you’re not resetting your query, so WordPress is running a new query on the posts you already got. After your first query add: wp_reset_query(); Always reset after any query that isn’t The Loop. Here’s the codex page on it: http://codex.wordpress.org/Function_Reference/wp_reset_query

Caching-Plugins and Ajax-Page-Parts

You can use following code to exclude page from caching. define(‘DONOTCACHEPAGE’, true); //Disables page caching for a given page. define(‘DONOTCACHEDB’, true); //Disables database caching for given page. define(‘DONOTMINIFY’, true); //Disables minify for a given page. define(‘DONOTCDN’, true); //Disables content delivery network for a given page. define(‘DONOTCACHCEOBJECT’, true); //Disables object cache for a given page and … Read more