검색결과를 카테고리별로 나오게 하는 방법.. – 한국워드프레스사용자모임 https://kopress.kr/topic/%ea%b2%80%ec%83%89%ea%b2%b0%ea%b3%bc%eb%a5%bc-%ec%b9%b4%ed%85%8c%ea%b3%a0%eb%a6%ac%eb%b3%84%eb%a1%9c-%eb%82%98%ec%98%a4%ea%b2%8c-%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/feed Wed, 16 Jul 2025 08:46:53 +0000 https://bbpress.org/?v=2.6.9 ko-KR https://kopress.kr/topic/%ea%b2%80%ec%83%89%ea%b2%b0%ea%b3%bc%eb%a5%bc-%ec%b9%b4%ed%85%8c%ea%b3%a0%eb%a6%ac%eb%b3%84%eb%a1%9c-%eb%82%98%ec%98%a4%ea%b2%8c-%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/#post-4370 <![CDATA[검색결과를 카테고리별로 나오게 하는 방법..]]> https://kopress.kr/topic/%ea%b2%80%ec%83%89%ea%b2%b0%ea%b3%bc%eb%a5%bc-%ec%b9%b4%ed%85%8c%ea%b3%a0%eb%a6%ac%eb%b3%84%eb%a1%9c-%eb%82%98%ec%98%a4%ea%b2%8c-%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/#post-4370 Wed, 13 Apr 2011 01:08:43 +0000 tonle8712 워드프레스로 홈페이지를 만들고 있는데요-
검색을 하면 검색결과가
한 카테고리 안에 있는 포스트들인데도

category1
– xxx

category1
-eee

category1
-www

이런식으로 각 포스트마다 카테고리명이 일일이 나와요..

카테고리를 눌러서 그 카테고리 페이지로 들어가도 목록이 저런식으로 뜨구요 ㅜ

한 카테고리에 있는 포스트들은

category1
-xxx
-eee
-www

이런식으로 검색결과가 뜨도록 하는 방법 없을까요?

밑에 코드는 테마의 ‘search.phhp(검색결과)’ 코드입니다.

<?php get_header( ); ?>
<div id=”container”>
<div id=”content”>
<h1 class=”page-title”><?php printf( __( ‘Search Results for: %s’, ‘codium_extend’ ), ‘<span>’ . get_search_query() . ‘</span>’ ); ?></h1>
<div class=”linebreak clear”></div>

<?php $posts=query_posts($query_string . ‘&posts_per_page=10’); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class=”dp100″>
<span class=”cat-links <?php codium_extend_post_class() ?>”><?php printf(__(‘%s’, ‘codium_extend’), get_the_category_list(‘ ‘)) ?></span>
</div>

<!– Begin post –>

<div id=”post-<?php the_ID() ?>” class=”<?php codium_extend_post_class() ?>”>
<h2 class=”entry-title”>” title=”<?php printf(__(‘Permalink to %s’, ‘codium_extend’), esc_html(get_the_title(), 1)) ?>” rel=”bookmark”><?php the_title() ?></h2>

<?/*

<div class=”entry-date”><abbr class=”published” title=”<?php the_time(‘Y-m-dTH:i:sO’); ?>”><?php unset($previousday); printf(__(‘%1$s – %2$s’, ‘codium_extend’), the_date(”, ”, ”, false), get_the_time()) ?></abbr></div>

<div class=”entry-content”>
<?php the_content(”.__(‘read more <span class=”meta-nav”>»</span>’, ‘codium_extend’).”); ?>
<?php wp_link_pages(“ttttt<div class=’page-link’>”.__(‘Pages: ‘, ‘codium_extend’), “</div>n”, ‘number’); ?>
</div>
<div class=”clear”></div>
<div class=”entry-meta”>
<?php the_tags(__(‘<span class=”tag-links”>Tags ‘, ‘codium_extend’), “, “, “</span>nttttt<span class=”meta-sep”>|</span>n”) ?>
<?php edit_post_link(__(‘Edit’, ‘codium_extend’), “ttttt<span class=”edit-link”>”, “</span>nttttt<span class=”meta-sep”>|</span>n”); ?>
<span class=”comments-link”><?php comments_popup_link(__(‘Comment (0)’, ‘codium_extend’), __(‘Comment (1)’, ‘codium_extend’), __(‘Comments (%)’, ‘codium_extend’)) ?></span>
</div>
*/?>

</div>
<!– End post –>

<div class=”linebreak clear”></div>

<?php endwhile; ?>

<div class=”center”>
<?php if(function_exists(‘wp_pagenavi’)) {
wp_pagenavi();
} else {?>
<div class=”navigation mobileoff”><p><?php posts_nav_link(); ?></p></div>
<?php } ?>
<div class=”navigation_mobile”><p><?php posts_nav_link(); ?></p></div>
</div>

</div><!– #content –>
</div><!– #container –>

<?/* <?php get_sidebar() ?> */?>
<?php get_footer() ?>

<?php else : ?>

<div id=”post-0″ class=”post no-results not-found”>
<h2 class=”entry-title”><?php _e( ‘Nothing Found’, ‘codium_extend’ ); ?></h2>
<div class=”entry-content”>
<p><?php _e( ‘Sorry, but nothing matched your search criteria. Please try again with some different keywords.’, ‘codium_extend’ ); ?></p>

<div id=”secondary” class=”sidebar”>
<ul class=”xoxo”>
<?php if (!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘SidebarBottom’) ) : // begin secondary sidebar widgets ?>

<?php endif; // end secondary sidebar widgets ?>

</div><!– #secondary .sidebar –>

<?/* <?php get_search_form(); ?> */?>
</div><!– .entry-content –>
</div><!– #post-0 –>
<script type=”text/javascript”>
// focus on search field after it has loaded
document.getElementById(‘s’) && document.getElementById(‘s’).focus();
</script>
<?php endif; ?>

</div><!– #content –>
</div><!– #container –>

<?/*
<?php get_sidebar() ?>
*/?>
<?php get_footer() ?>

답변 부탁드립니다!!! ㅜ

]]>