2011-01-14 109 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> 

我假設你知道編輯主題的基礎知識,但如果沒有,只是這麼說!或者,您可以使用'cat'而不是'post_type'來按照類別分開您的帖子,而不是兩種不同的類型。如果您不打算添加任何額外字段來啓用音頻/視頻功能,我建議使用類別。

0

我不知道如果我理解得很好,但我會使用的Widget插件的邏輯http://wordpress.org/extend/plugins/widget-logic/

如果你想死您的模板,您可能需要檢查query_posts()reset_posts Widget和(做)finctions:http://codex.wordpress.org/Function_Reference/query_posts

你知道如何使用WordPress Codex嗎?你知道這個循環是如何工作的嗎?如果是的話,你可能想用第二種方式,如果不嘗試用第一種方法做。

祝你好運, gezope

相關問題