Display articles with a different template in the home page | Solved |

I haven’t tested this, but it looks like you just need to set an iteration variable (usually abbreviated $i), like this:

<?php
$i = 0; // This sets your variable
$query = [
'post_type' => 'post',
'posts_per_page' => 5
];

$query = new WP_Query($query);
  while ($query->have_posts()) : {
    $query->the_post();
    if($i == 0) :
      get_template_part('loops/acc-cards');
    else() :
      get_template_part('loops/cards');
  }
$i++ // This iterates the iteration variable $i
wp_reset_postdata();
?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)