archives - How to get post type and monthyear before while loop for date.php file

I am trying to create a date.php file for archives for some custom post types. I am using a while loop to get the posts:

I am trying to create a date.php file for archives for some custom post types. I am using a while loop to get the posts:

<?php while (have_posts()) : the_post(); ?>

I want to customize the date.php file such that it caters to the specific post types that the archive page is for e.g. creating page titles such as "Custom Post Type Name Archives".

Is there any function where I can get the post type that the archive is referring to BEFORE the while loop? And also for monthly/ yearly archives, is there any way to get the month/date of the posts before the loop begins?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744875645a4598531.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信