Function not being Ajaxized (no output)
-
Hello,
I have the following function that is working great in my theme. This randomly swaps between two featured images for a post using the Multi Post Thumbnails plugin.
When I enter this function into Ajaxize there is no output. Is there anything here that you can see would be causing that? This is the only thing I need to be not cached on the home page of a site.
function fapp_random_feature() { // Get a random number $min = 1 ; $max = 10; $num = rand($min,$max); if ( $num & 1 && has_post_thumbnail() ) { // if it is an odd number and we have a featured image ?> <a class="feature-img" href="<?php echo get_permalink(); ?>"><?php the_post_thumbnail('fapp-thumb-800'); ?></a> <?php } elseif ( $num % 2 == 0 && class_exists('MultiPostThumbnails') && MultiPostThumbnails(has_post_thumbnail( 'post', 'secondary-image', NULL) ) { // If it is an even number and we have a second featured image ?> <a class="feature-img" href="<?php echo get_permalink(); ?>"><?php MultiPostThumbnails(the_post_thumbnail('post', 'secondary-image', NULL, 'fapp-thumb-800')); ?></a> <?php } else { // It's even and we don't have a second feature image so get the default feature image if ( has_post_thumbnail() ) { ?> <a class="feature-img" href="<?php echo get_permalink(); ?>"><?php the_post_thumbnail('fapp-thumb-800'); ?></a> <?php } } }
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Function not being Ajaxized (no output)’ is closed to new replies.