2011-01-14 5 views

답변

1
<div class="leftcol"> 
    <?php $args = array('post_type' => 'video_post'); //select only posts of type 'video_post' 
    $wp_query = new WP_Query($args); 
    while (have_posts()) : the_post(); ?> 
     <div class="post"> 
      <h3><?php the_title() ?></h3> 
      <?php the_content() ?> 
     </div> 
    <?php endwhile; rewind_posts(); ?> 
</div> 

<div class="rightcol"> 
    <?php $args = array('post_type' => 'audio_post'); //select only posts of type 'audio_post' 
    $wp_query = new WP_Query($args); 
    while (have_posts()) : the_post(); ?> 
     <h2><?php the_title() ?></h2> 
    <?php endwhile; rewind_posts(); ?> 
</div> 

gezope! 또는 'post_type'대신 'cat'을 사용하여 두 가지 유형 대신 카테고리별로 소식을 구분할 수도 있습니다. 오디오/비디오 기능을 사용하기 위해 추가 필드를 추가하지 않으려는 경우 범주를 사용하는 것이 좋습니다.

0

는 잘 모르겠지만, 난 당신이합니다 (query_posts를 확인해야 할 수 있습니다 템플릿을 하드 코딩하려면 위젯 로직 플러그인 http://wordpress.org/extend/plugins/widget-logic/

를 사용하여 위젯)와 reset_posts (함께 할 것) finctions : http://codex.wordpress.org/Function_Reference/query_posts

WordPress Codex 사용법을 알고 계십니까? 루프가 어떻게 작동하는지 알고 있습니까? 그렇다면 첫 번째 옵션으로 시도하지 않을 경우 두 번째 방법을 사용하는 것이 좋습니다.

행운을 빌어 요, 난 당신이 테마를 편집의 기본을 알고 가정이 아닌 경우, 그냥 그렇게 말을하고있어

관련 문제