안녕하세요.
기본 카테고리 사용시 각 카테고리의 끝에 게시물 개수를 표기하는 방법에 대해 문의드립니다.
해당 내용으로 검색을 해보았는데 3, 4년 전에 답변된 것들이라 코드가 제대로 적용이 되지 않습니다.
contact-form 스킨을 사용하였고, 게시물 관리자 페이지인 admin-list.php 상단 카테고리에 아래와 같이
표시되었으면 합니다.
[예시]
- 카테고리1 : A, B, C
- 카테고리2 : D, E, F
[표시]
- 카테고리1 : 전체(10) A(5) B(3) C(2)
- 카테고리2 : 전체(10) D(4) E(3) F(3)
그럼 답변 부탁드립니다.
감사합니다.
안녕하세요~^^
KBoard 플러그인 컨택트폼(Contact Form) 스킨에서
기본 카테고리를 사용할 경우 해당 카테고리로 등록된 게시글을 카테고리에 표시되게 하시려면
FTP로 접속해서 /wp-content/plugins/kboard/skin/사용중인스킨/list-category-default.php 파일의 코드를
아래의 코드로 교체해서 확인해보시겠어요?
<div class="kboard-category category-mobile">
<form id="kboard-category-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
<?php echo $url->set('pageid', '1')->set('category1', '')->set('category2', '')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<?php if($board->initCategory1()):?>
<?php $category_count = $board->getCategoryCount(array('category1'=>''))?>
<select name="category1" onchange="jQuery('#kboard-category-form-<?php echo $board->id?>').submit();">
<option value=""><?php echo __('All', 'kboard')?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></option>
<?php while($board->hasNextCategory()):?>
<?php $category_count = $board->getCategoryCount(array('category1'=>$board->currentCategory()))?>
<option value="<?php echo $board->currentCategory()?>"<?php if(kboard_category1() == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></option>
<?php endwhile?>
</select>
<?php endif?>
<?php if($board->initCategory2()):?>
<?php $category_count = $board->getCategoryCount(array('category2'=>''))?>
<select name="category2" onchange="jQuery('#kboard-category-form-<?php echo $board->id?>').submit();">
<option value=""><?php echo __('All', 'kboard')?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></option>
<?php while($board->hasNextCategory()):?>
<?php $category_count = $board->getCategoryCount(array('category2'=>$board->currentCategory()))?>
<option value="<?php echo $board->currentCategory()?>"<?php if(kboard_category2() == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></option>
<?php endwhile?>
</select>
<?php endif?>
</form>
</div>
<div class="kboard-category category-pc">
<?php if($board->initCategory1()):?>
<?php $category_count = $board->getCategoryCount(array('category1'=>''))?>
<ul class="kboard-category-list">
<li<?php if(!kboard_category1()):?> class="kboard-category-selected"<?php endif?>><a href="<?php echo $url->set('category1', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->tostring()?>"><?php echo __('All', 'kboard')?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></a></li>
<?php while($board->hasNextCategory()):?>
<?php $category_count = $board->getCategoryCount(array('category1'=>$board->currentCategory()))?>
<li<?php if(kboard_category1() == $board->currentCategory()):?> class="kboard-category-selected"<?php endif?>>
<a href="<?php echo $url->set('category1', $board->currentCategory())->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toString()?>"><?php echo $board->currentCategory()?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></a>
</li>
<?php endwhile?>
</ul>
<?php endif?>
<?php if($board->initCategory2()):?>
<?php $category_count = $board->getCategoryCount(array('category2'=>''))?>
<ul class="kboard-category-list">
<li<?php if(!kboard_category2()):?> class="kboard-category-selected"<?php endif?>><a href="<?php echo $url->set('category2', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->tostring()?>"><?php echo __('All', 'kboard')?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></a></li>
<?php while($board->hasNextCategory()):?>
<?php $category_count = $board->getCategoryCount(array('category2'=>$board->currentCategory()))?>
<li<?php if(kboard_category2() == $board->currentCategory()):?> class="kboard-category-selected"<?php endif?>>
<a href="<?php echo $url->set('category2', $board->currentCategory())->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toString()?>"><?php echo $board->currentCategory()?><?php if($category_count):?>(<?php echo $category_count?>)<?php endif?></a>
</li>
<?php endwhile?>
</ul>
<?php endif?>
</div>
고맙습니다.
알려주신 코드로 교체하니까 한방에 해결됐습니다.
감사합니다^^