1- Öncelikle ürünler için custom post oluşturup; her bir ürünün başlık, açıklama ve öne çıkan görselini belirledim.
2- Herhangi bir ürünün detaylarına aşağıdaki link sayesinde gidebiliyoruz. Burada bir problem yok.
<?= bloginfo('home') ?>/urun-detaylari/?id=<?= $id ?>/
3- Fakat aşağıdaki kodları kullanarak custom post 'daki title ve öne çıkan görselleri çekmeye çalıştığımda sondan başlayarak kaç kere döngü dönerse o kadar ürün bilgisi gösteriyor. Ama ben sadece tıkladığım ürünün detaylarını görmek istiyorum. Bunu nasıl yapabilirim ? Bilen bir üstadım yardımcı olabilir mi lütfen?

<?php
$args = array(
    'post_type' => 'slider',
    // Döngü kaç kere dönsün?
    'posts_per_page' => 1,
);
$loop = get_posts($args); ?>

<?php foreach ( $loop as $post ) : setup_postdata( $post ); ?>

<?= the_title(); ?>

<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'thumbnail' ); ?>
<img src="<?= $url ?>">

<?php endif; ?>     

<?php endforeach;
    wp_reset_postdata(); 
?>