He estado intentando (y fallando molestamente) hacer que funcione un cargador de publicaciones Ajax.
Este es el jQuery que estoy usando (es de esta publicación anterior de StackOverflow: "Cargar más publicaciones" con Ajax en wordpress ), pero simplemente no funciona ... Solo estoy tratando de obtener una lista de isótopos para cargar más ajax pero todo estoy intentando está fallando.
jQuery(document).ready(function($){ $('.pagination a').click(function(e) { e.preventDefault(); $('.filtered-posts').append("<div class=\"loader\"> </div>"); var link = jQuery(this).attr('href'); var $content = '.filtered-posts'; var $nav_wrap = '.pagination'; var $anchor = '.pagination a'; var $next_href = $($anchor).attr('href'); // Get URL for the next set of posts $.get(''+link+' .item', function(data){ var $timestamp = new Date().getTime(); var $new_content = $($content, data).wrapInner('').html(); // Grab just the content $('.filtered-posts .loader').remove(); $next_href = $($anchor, data).attr('href'); // Get the new href $($nav_wrap).before($new_content); // Append the new content $('#rtz-' + $timestamp).hide().fadeIn('slow'); // Animate load $('.pagination a').attr('href', $next_href); // Change the next URL $('.pagination:last').remove(); // Remove the original navigation }); });});Esto es lo que estoy usando para mi js, pero simplemente no carga nada cuando hago clic en el enlace anterior_posts_link estándar/next_posts_link.
Puse un contenedor div alrededor de ellos para forzar la paginación anterior. Funcionó brevemente, pero solo estaba llamando a las mismas 9 publicaciones una vez y luego no funcionó.
Cualquier ayuda sería genial. O si alguien tiene una guía de paginación Ajax diferente que sabe que funciona...
Gracias por adelantado :)