استخدم هذا الكود للحصول على ارشيف الموقع بالاشهر

<?php
$all_posts = get_posts(array(
 'posts_per_page' => -1, // to show all posts
 'post_type' => 'news'

));

$ordered_posts = array();

foreach ($all_posts as $single) {

 $year = mysql2date('Y', $single->post_date);
 $month = mysql2date('F', $single->post_date);


 $ordered_posts[$year][$month][] = $single;


}

foreach ($ordered_posts as $year => $months) { ?>

<?php foreach ($months as $month => $posts ) { // iterates the moths ?>
   


  <a href=" link here ">
				<div class="arch-year-month">
				 
				<div class="arch-month"><?php echo $month ?></div><div class="arch-year"> <?php echo $year ?></div></div></a>
				
				
				
   <?php } 
   ?>
  <?php
} 

?>

لكن عند اضافة

<?php the_permalink(); ?>

لا يحصل على الرابط