Ajax Slideshow in Post

OK, this turned out to be really simple, flexible and awesome. Your single.php: <div class=”post-body”> <?php the_content(); ?> <div class=”post-pagination”> <?php wp_link_pages(‘before=<p>&after=</p>&next_or_number=number&pagelink= %’); ?> </div> </div> Your script.js: $(document).ready(function(){ jQuery(‘.post-pagination a’ ).live(‘click’, function(e){ e.preventDefault(); var link = jQuery(this).attr(‘href’); jQuery(‘.post-body’).load(link + ‘ .post-body ‘, function(){ jQuery(‘.post-pagination p’).show(); }); return false; }); }); Your post markup: <img … Read more

apply_filters, EMBEDS and AJAX not a friends? [duplicate]

As you haven’t posted, what exactly you’re doing with AJAX, we can just guess. And I guess, that you’re doing it extremly wrong – no need to “hook/filter” in ajax. AJAX is for admin(?) Basically, AJAX stuff is meant to be admin stuff. This means, that you got a wp_ajax_ hook and a wp_ajax_nopriv_ hook, … Read more

using Ajax: call to undefined function get_option

Basically, if you’re going to be making calls to WordPress functions, then you should be in the WordPress environment, which means that you should not be calling your own files to begin with, but should implement your AJAX call within a WordPress hook. Read up on this: http://codex.wordpress.org/AJAX_in_Plugins That article describes how to implement AJAX … Read more

ajax page template

As it seems, it’s an easier way, using get_template_part and some php magic. What you do is get the page name from post_metadata filter the filename without the extension and add it to get_template_part. Of course all your data must conform a predefined variable (or just pass the id to the template) because you have … Read more

Posting to loop.php file

If that is the sum total of your loop.php, and you are accessing it directly which you are, your biggest problem is that you aren’t going to have access to any WordPress functions and yet you are trying to use WordPress functions. You are going to get fatal errors. Your script does nothing to boot … Read more

where does my function output from load-* go?

Ok, I’ve solved my problem, though my question (why I need to put die() at the end of my load-* function to let it show) remains unanswered. I couldn’t find any way to use tb_show and at the same time send super global post variables to the destination url. tb_show simply calls a url and … Read more

Ajax object comes back empty

This stackoverflow answer has a good example of basic ajax posting. https://stackoverflow.com/questions/5004233/jquery-ajax-post-example I would try adjusting your code so that the info you want to post is in the data parameter. jQuery isn’t my strongest suit, but I was under the impression that the $_POST data came through that parameter. $(‘.walkthrough-list’).find(‘a’).each(function() { $(this).click(function() { data=”p=”+p_name+&uid=’+user_meta.current_user_id+’&tut_name=”+clicked_post; … Read more

Memberpress isn’t cooperating with WooCommerce

Just solved this. Under memberpress options, we had to uncheck the option to “Keep members out of the WordPress Dashboard”. That was it! I think the woocommerce checkout page was using ajax to call “admin-ajax.php”. Memberpress was preventing users from accessing this page so it brought up the login redirect page instead. We’ll keep users … Read more

update_user_meta updates to a wrong ID

That’s likely because you are using $current_user->ID, which always refers to the currently logged in user, or when “empty” object if not logged in (ID == 0). If you would like to update user meta on any other user you would have to supply the user ID of that user in the $_POST data as … Read more

Caching for logged in user and Ajax update

There are plugins that can help you with this, but they aren’t foolproof. My suggestion is W3 Total Cache, you should be able to exclude necessary files from the cache from there. Your best solution, however is to do caching on the serverside level as you will see better performance that way.