我编辑了标准的 wordpress 日历以根据类别突出显示日期的颜色,日历功能使用get_day_link()
它加载当天的所有帖子,但是我想将其限制为特定类别。这是使days可点击链接的代码,这是对general-template.php文件的编辑,功能是get_calendar()
if ( in_array($day, $daywithevent) && in_array($day, $daywithtraining) ) // are there both events AND training happening today?
$calendar_output .= '<td class="training-events-calendar"><a href="' . get_day_link( $thisyear, $thismonth, $day ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) . "\">$day</a>";
elseif ( in_array($day, $daywithtraining ) ) // how about just training?
$calendar_output .= '<td class="training-calendar"><a href="' . get_day_link( $thisyear, $thismonth, $day ) . "\">$day</a>";
elseif ( in_array($day, $daywithevent) ) //how about just events?
$calendar_output .= '<td class="event-calendar"><a href="' . get_day_link( $thisyear, $thismonth, $day ) . "\">$day</a>";
else
$calendar_output .= '<td>'.$day;
$calendar_output .= '</td>';
有什么我可以添加到网址的吗?喜欢查询以使这 3 个链接类别具体化吗?好像没有什么要补充的get_day_link
谢谢