我的自定义存档页是:
<?php get_header();
print (\'<div class="row">\');
$archi = wp_get_archives(\'echo=0\');
$archi = explode( \'</li>\' , $archi );
$archi_count = count($archi);
$count = 1;
$itemCount = 0;
foreach( $archi as $link ) {
$link = str_replace( array( \'<li>\' , "\\n" , "\\t" , "\\s" ), \'\' , $link );
if($count == 1) {
print(\'<div class="medium-4 large-4 columns category_list"><ul>\');
$itemCount++;
}
if(!empty($link)){
$arr = array($link);
print(\'<li>\' . $arr[\'0\'] . \'</li> \');
$itemCount++;
}
else continue;
if($count == (ceil($archi_count/3))) {
print(\'</ul></div>\');
$count=1;
}
else $count++;
}
if ($count != (ceil($archi_count/3)) && $count > 1) // If last column does not have it\'s 7 items, then close the column
print(\'</ul></div>\');
print(\'</div>\');
get_footer(); ?>
它显示了几个月的归档链接列表,如2014年4月。当我单击时,它会重定向到htttp://www.mysite.com/blog/2014/04.在这个页面中,我如何显示2014年4月发布的所有帖子。?中的平均值date.php..我的约会对象。php
<?php
$args = array( ****WHAT ARE THE ARGUMENTS I HAVE TO PASS HERE?****);
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post);
archive_row();
endforeach; ?>
在功能中。phpfunction archive_row() { // archive rows archive.php, date.php
echo \'<div class="large-3 medium-3 columns"><a href="\' . get_permalink() .\'" title="\' . get_the_title() . \'"><img src="\' .archive_thumb() .\'" alt="Banner Image x 4" style="width:100%" /></a><a href="\' .get_permalink() . \'" title="\' . get_the_title() . \'">\' . get_the_title() .\'</a></div>\';
}