최신순, 추천순, 조회순, 업데이트순의 리스트 형식을
스샷처럼 버튼형식으로 바꿔주려면 어떻게 해야 할까요?
아래의 코드처럼 해주시면 됩니다.
<button name="kboard_list_sort" type="submit" value="newest"<?php if($list->getSorting() == 'newest'):?> style="color: red;"<?php endif?>><?php echo __('Newest', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="best"<?php if($list->getSorting() == 'best'):?> style="color: red;"<?php endif?>><?php echo __('Best', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="viewed"<?php if($list->getSorting() == 'viewed'):?> style="color: red;"<?php endif?>><?php echo __('Viewed', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="updated"<?php if($list->getSorting() == 'updated'):?> style="color: red;"<?php endif?>><?php echo __('Updated', 'kboard')?></button>
위 코드에서 if($list->getSorting() == 'newest') 부분은
현재 선택된 게시글 정렬이 최신순인지 체크합니다.
고맙습니다.
안녕하세요~^^
FTP로 접속해서 /wp-content/plugins/kboard/skin/사용중인스킨/list.php 파일에
아래의 코드를 찾아서
<select name="kboard_list_sort" onchange="jQuery('#kboard-sort-form-<?php echo $board->id?>').submit();">
<option value="newest"<?php if($list->getSorting() == 'newest'):?> selected<?php endif?>><?php echo __('Newest', 'kboard')?></option>
<option value="best"<?php if($list->getSorting() == 'best'):?> selected<?php endif?>><?php echo __('Best', 'kboard')?></option>
<option value="viewed"<?php if($list->getSorting() == 'viewed'):?> selected<?php endif?>><?php echo __('Viewed', 'kboard')?></option>
<option value="updated"<?php if($list->getSorting() == 'updated'):?> selected<?php endif?>><?php echo __('Updated', 'kboard')?></option>
</select>
아래의 코드로 교체해보시겠어요?
<button name="kboard_list_sort" type="submit" value="newest"><?php echo __('Newest', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="best"><?php echo __('Best', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="viewed"><?php echo __('Viewed', 'kboard')?></button>
<button name="kboard_list_sort" type="submit" value="updated"><?php echo __('Updated', 'kboard')?></button>
고맙습니다.