[재문의]최신글 앞에 카테고리 테이블 너비수정

안녕하세요 최신글 제목 앞에 카테고리를 생성하고싶어서 아래의 링크를 보고 수정했습니다.

https://www.cosmosfarm.com/threads/document/15468

여기서 카테고리쪽 너비를 수정하고싶어서

#kboard-forum-one-latest table .kboard-latest-category1 { width: 50px !important; }

이런식으로 변경해봤는데 변경이 안되서 문의 드립니다. (위 코드는 적용이 안되서 지워뒀습니다.)

최신글에 (카테고리 | 제목 | 날짜) 이렇게 나와있는데 각 너비를 수정하고싶습니다.

 

수정한 코드:

latest.php

<div id="kboard-default-latest">
	<table>
		<thead>
			<tr>
				<th class="kboard-latest-category1"><?php echo __('Category', 'kboard')?>1</th>
				<!-- <th class="kboard-latest-category1">
					<?php if($content->category1 == '카테고리1'):?><span class="kboard-cat-category" style="background-color:#F992AF;">카테고리1</span><?php endif?>
					<?php if($content->category1 == '카테고리2'):?><span class="kboard-cat-category" style="background-color:#70C4E0;">카테고리2</span><?php endif?>
					<?php if($content->category1 == '카테고리3'):?><span class="kboard-cat-category" style="background-color:#B6C2FC;">카테고리3</span><?php endif?>
					<?php if($content->category1 == '카테고리4'):?><span class="kboard-cat-category" style="background-color:#FBD371;">카테고리4</span><?php endif?>
				</th> -->
				<!-- <th class="kboard-latest-category2"><?php echo __('Category', 'kboard')?>2</th> -->
				<th class="kboard-latest-title"><?php echo __('Title', 'kboard')?></th>
				<th class="kboard-latest-date"><?php echo __('Date', 'kboard')?></th>
			</tr>
		</thead>
		<tbody>
			<?php while($content = $list->hasNext()):?>
			<tr>
				<!-- <td class="kboard-latest-category1"><span class="category-style"><?php echo $content->category1?></span></td> -->
				<td class="kboard-latest-category1">
					<?php if($content->category1 == '카테고리1'):?><span class="kboard-cat-category" style="background-color: #F992AF;">카테고리1</span><?php endif?>
					<?php if($content->category1 == '카테고리2'):?><span class="kboard-cat-category" style="background-color:#70C4E0;">카테고리2</span><?php endif?>
					<?php if($content->category1 == '카테고리3'):?><span class="kboard-cat-category" style="background-color:#B6C2FC;">카테고리3</span><?php endif?>
					<?php if($content->category1 == '카테고리4'):?><span class="kboard-cat-category" style="background-color:#FBD371;">카테고리4</span><?php endif?>
				</td>
				<!-- <td class="kboard-latest-category2"><?php echo $content->category2?></td> -->
				<td class="kboard-latest-title">
					<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toStringWithPath($board_url)?>">
						<div class="kboard-default-cut-strings">
							<?php if($content->isNew()):?><span class="kboard-default-new-notify">N</span><?php endif?>
							<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
							<?php echo $content->title?>
							<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
						</div>
					</a>
				</td>
				<td class="kboard-latest-date"><?php echo $content->getDate()?></td>
			</tr>
			<?php endwhile?>
		</tbody>
	</table>
</div>

style.css

#kboard-default-latest table .kboard-latest-category1{}
#kboard-default-latest table .kboard-latest-category1 .kboard-cat-category{display: inline-block;
    position: relative;
    margin-right: 14px;
    height: 22px;
    line-height: 22px;
    padding: 0 8px;
    font-size: 16px;
    color: #fff;
    letter-spacing: -.46px;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    vertical-align: 1px;}

 

확인할 사이트: 여기를 눌러주세요

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기