<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[계층형 카테고리 숏코드 문의입니다.]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/27564</link>
		<description><![CDATA[<p>워드프레스 게시판 KBoard(케이보드) 사용중입니다.</p>

<p>계층형 카테고리를 페이지 마다 삽입하려고 하는데</p>

<p>어떻게 해야할지 모르겠습니다.</p>

<p>예제 하나만 써주실수 있나요?</p>

<p>카테고리는 product 밑에 1,2,3,4,5 이런 형식으로 되어있습니다</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[적용해 보겠습니다~ 감사합니다!!]]></title>
			<link>https://www.cosmosfarm.com/threads/document/27588</link>
			<description><![CDATA[<p>적용해 보겠습니다~ 감사합니다!!</p>]]></description>
			<author>취한팬더</author>
			<pubDate>Thu, 15 Nov 2018 03:06:13 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

KBoard 플러그인에서 특정 게시판의 계층형 카테고리를 숏코드로 표시하시려면

1. 워드...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/27574</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>KBoard 플러그인에서 특정 게시판의 계층형 카테고리를 숏코드로 표시하시려면</p>

<p>1. 워드프레스 관리자 -&gt; 외모 -&gt; 테마 편집기 페이지에서 functions.php 파일 하단에</p>

<p>아래의 코드를 추가해보시겠어요?</p>

<pre>
<code class="language-html">add_shortcode('kboard_tree_category', 'my_kboard_tree_category');
function my_kboard_tree_category($atts=array()){
	$board_id = isset($atts['id']) ? $atts['id'] : '';
	$action = isset($atts['url']) ? $atts['url'] : '';
	
	$url = new KBUrl();
	$board = new KBoard($board_id);
	
	if($board_id){
		ob_start();
		?&gt;
		&lt;div class="kboard-tree-category-search"&gt;
			&lt;form id="kboard-tree-category-search-form-&lt;?php echo $board-&gt;id?&gt;" method="get" action="&lt;?php echo $action?&gt;"&gt;
				&lt;?php echo $url-&gt;set('pageid', '1')-&gt;set('target', '')-&gt;set('keyword', '')-&gt;set('mod', 'list')-&gt;toInput()?&gt;
				
				&lt;div class="kboard-tree-category-wrap"&gt;
					&lt;?php $tree_category_list = $board-&gt;tree_category-&gt;getCategoryItemList()?&gt;
					&lt;div class="kboard-search-option-wrap-&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt; kboard-search-option-wrap type-tab"&gt;
						&lt;input type="hidden" name="kboard_search_option[tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;][key]" value="tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;"&gt;
						&lt;input type="hidden" name="kboard_search_option[tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;][value]" value="&lt;?php echo $board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth)?&gt;"&gt;
						&lt;ul class="kboard-tree-category"&gt;
							&lt;li&lt;?php if(!$board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth)):?&gt; class="kboard-category-selected"&lt;?php endif?&gt;&gt;&lt;a href="#" onclick="return my_kboard_tree_category_search('&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;', '')"&gt;&lt;?php echo __('All', 'kboard')?&gt;&lt;/a&gt;&lt;/li&gt;
							&lt;?php foreach($tree_category_list as $item):?&gt;
							&lt;li&lt;?php if($board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth) == $item['category_name']):?&gt; class="kboard-category-selected"&lt;?php endif?&gt;&gt;&lt;a href="#" onclick="return my_kboard_tree_category_search('&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;', '&lt;?php echo $item['category_name']?&gt;')"&gt;&lt;?php echo $item['category_name']?&gt;&lt;/a&gt;&lt;/li&gt;
							&lt;?php endforeach?&gt;
						&lt;/ul&gt;
					&lt;/div&gt;
					
					&lt;?php foreach($board-&gt;tree_category-&gt;getSelectedList() as $key=&gt;$category_name):?&gt;
						&lt;?php $tree_category_list = $board-&gt;tree_category-&gt;getCategoryItemList($category_name)?&gt;
						&lt;?php if($tree_category_list):?&gt;
						&lt;div class="kboard-search-option-wrap-&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt; kboard-search-option-wrap type-tab"&gt;
							&lt;input type="hidden" name="kboard_search_option[tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;][key]" value="tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;"&gt;
							&lt;input type="hidden" name="kboard_search_option[tree_category_&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;][value]" value="&lt;?php echo $board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth)?&gt;"&gt;
							&lt;ul class="kboard-tree-category"&gt;
								&lt;li&lt;?php if(!$board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth)):?&gt; class="kboard-category-selected"&lt;?php endif?&gt;&gt;&lt;a href="#" onclick="return my_kboard_tree_category_search('&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;', '')"&gt;&lt;?php echo __('All', 'kboard')?&gt;&lt;/a&gt;&lt;/li&gt;
								&lt;?php foreach($tree_category_list as $item):?&gt;
								&lt;li&lt;?php if($board-&gt;tree_category-&gt;getCategoryNameWithDepth($board-&gt;tree_category-&gt;depth) == $item['category_name']):?&gt; class="kboard-category-selected"&lt;?php endif?&gt;&gt;&lt;a href="#" onclick="return my_kboard_tree_category_search('&lt;?php echo $board-&gt;tree_category-&gt;depth?&gt;', '&lt;?php echo $item['category_name']?&gt;')"&gt;&lt;?php echo $item['category_name']?&gt;&lt;/a&gt;&lt;/li&gt;
								&lt;?php endforeach?&gt;
							&lt;/ul&gt;
						&lt;/div&gt;
						&lt;?php endif?&gt;
					&lt;?php endforeach?&gt;
				&lt;/div&gt;
			&lt;/form&gt;
		&lt;/div&gt;
		
		&lt;script&gt;
		function my_kboard_tree_category_search(index, value){
			var length = jQuery('.kboard-search-option-wrap').length;
			var tree_category_index = parseInt(index) +1;

			if(value){
				jQuery('input[name="kboard_search_option[tree_category_'+index+'][value]"]').val(value);
			}
			else{
				jQuery('input[name="kboard_search_option[tree_category_'+index+'][value]"]').val('');
			}
			
			for(var i=tree_category_index; i&lt;=length; i++){
				jQuery('.kboard-search-option-wrap-'+i).remove();
			}
			jQuery('#kboard-tree-category-search-form-1').submit();
			
			return false;
		}
		&lt;/script&gt;
		&lt;?php
		return ob_get_clean();
	}
}</code></pre>

<p><br />
 </p>

<p>2. 워드프레스 관리자 -&gt; 외모 -&gt; 사용자 정의하기 -&gt; CSS 입력 필드에</p>

<p>아래의 코드를 추가해보시겠어요?</p>

<pre>
<code class="language-css">.kboard-tree-category-wrap { overflow: hidden; }
.kboard-tree-category-wrap select { display: inline; margin: 0 0 5px 0; padding: 0; width: 100%; height: 28px; line-height: 28px; font-size: 12px; color: #666666; border-radius: 0; border: 1px solid #f1f1f1; background: white; vertical-align: middle; box-shadow: none; box-sizing: border-box; text-indent: 0; -webkit-appearance: menulist; -moz-appearance: menulist; appearance: menulist; }
.kboard-tree-category-search .kboard-search-option-wrap.type-select { width: auto; }
.kboard-tree-category-search .kboard-search-option-wrap.type-tab { width: 100%; }
.kboard-tree-category { float: left; margin: 0 0 5px 0; padding: 0; width: 100%; list-style: none; border: 0; background-color: #f9f9f9; overflow: hidden; }
.kboard-tree-category li { display: inline-block; *display: inline; zoom: 1; margin: 0; padding: 0 5px; border: 0; list-style: none; }
.kboard-tree-category li::before,
.kboard-tree-category li::after { display: none; }
.kboard-tree-category li a { display: block; padding: 10px 10px 8px 10px; font-size: 13px; border: 0; border-bottom: 2px solid transparent; text-decoration: none; text-shadow: none; box-shadow: none; color: #515151; }
.kboard-tree-category li.kboard-category-selected a { font-weight: bold; border-bottom: 2px solid #545861; color: #545861; }
.kboard-tree-category-search { float: left; width: 100%; }
.kboard-tree-category-search .kboard-search-option-wrap { margin-right: 5px; float: left; }</code></pre>

<p>3. 페이지나 위젯에 아래의 숏코드를 추가해보세요.</p>

<pre>
<code>[kboard_tree_category id="1" url="게시판주소"]</code></pre>

<p>위의 코드에서 id 부분은 실제 게시판 id로 적용해보세요.</p>

<p>url 부분은 실제 게시판 주소로 적용해보세요.</p>

<p> </p>

<p>안내해드린 코드는 탭 형식 계층형 카테고리를 기준으로 안내해드렸습니다.</p>

<p>셀렉트 형식 계층형 카테고리로 적용하시려면</p>

<p>아래의 코드에서 생략된 부분의 코드를</p>

<p>FTP로 접속해서 /wp-content/plugins/kboard/skin/사용중인스킨/list-category-tree-select.php 파일의 코드로 교체해보시겠어요?</p>

<pre>
<code class="language-php">ob_start();
?&gt;
...

&lt;script&gt;</code></pre>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 15 Nov 2018 01:31:00 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>