0
카테고리에 따라 날짜의 색상을 강조하기 위해 표준 WordPress 캘린더를 편집 했으므로 캘린더 기능은 해당 날짜에 모든 게시물을로드하는 get_day_link()
을 사용하지만 특정 카테고리로만 제한하려고합니다 . 여기에 일 클릭 가능한 링크를 만드는 코드는 내가 URL에 추가 할 수 아무것도 기능이 get_calendar()
wordpress, 아카이브 페이지 카테고리 지정하기
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>';
이다, 이것은 일반 template.php 파일의 편집입니다 있나요입니까? 이러한 3 개의 링크 카테고리를 구체적으로 만드는 쿼리를 좋아합니까? get_day_link
감사
감사하지만 문제는 위의 코드에서 변수를 기반으로 한 날짜에 대한 쿼리가 필요하지만 어딘가에서 내 루프 내에서 해당 루프를 구현하려고 시도 할 수 있습니다. – Adrian
oo 나중에 나는 dat를 남겼다. 나는 나의 대답을 편집했다. 그게 도움이 될거야 :) – anstrangel0ver
고마워,하지만 문제는 내 코드가 아카이브 URL을 생성하기 위해'get_day_link'를 사용하기 때문에이 루프를 클릭 가능한 URL로 만드는 방법이다. – Adrian