Button Loading 3 more posts

Asked

Viewed 496 times

2

I’m wanting my button id="boot" (<div id="boot">) each time it is pressed, charge +3 testimonials.

<?php 
query_posts( array ( "category_name" => "depo" ));
if (have_posts()) : while (have_posts()) : the_post(); 
?>
<article id="post-28" role="article" style="margin-left:20px;">

<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>

<h1 class="titulo-depo" ><b><a class="index-tro"href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></b></h1>
<h2 class="depo-p"><b><?=the_content();?></b></h2>

</article>

<?php 

$cont_banner++;
endwhile; ?>

<?php else : ?>

<?php endif; ?> 
<div id="bott"><a href="eventos.php"><p>+DEPOIMENTOS</p></a></div><br /><br /><br /><br />

1 answer

0

Have you tried using Wp_query? And then you can make the pagination... There you have the option to make in hand or use the jetpack plugin to make the scroll / Infinite button to load more.

<?php 
$args = array(
  'category_name' => 'depo',
  'posts_per_page'  => 3
);
$query = new WP_Query($args);
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); 
?>

https://codex.wordpress.org/Class_Reference/WP_Query

I hope I’ve helped, if there’s anything else I can do, just talk =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.