2012-02-10 12 views
1

私はワードプレスで問題が発生しました。私はワードプレスで特定の投稿を表示したいが、私はそれをやる方法を知らない、またはロジックを持っていない。私が使用するこのコードは素晴らしい作品です。ワードプレスの複数の特定のPOST

<div id="1"> 
// retrieve one post with an ID of 1 
query_posts('p=1'); 

global $more; 
$more = 0; 
// the Loop 
while (have_posts()) : the_post(); 
// the content of the post 
the_content(); 
endwhile; 
?> 
</div> 

Good!今私はそれがこのように表示したい、この

<div id="1"> 
// POST 1 here 
</div> 

<div id="2"> 
// POST 2 Here 
</div> 

<div id="3"> 
// POST 3 Here 
</div> 

を行う方法のロジックを見つけることができないように行くここ

答えて

1

ありがとうございます。 :)私はquery_posts IDで注文し、昇順で注文するように変更しました(例えば、1,2,3,5,29,199など)。

<?php 
    // retrieve one post with an ID of 1 
    query_posts('orderby=ID&order=ASC'); 

    global $more; 
    $more = 0; 
    // the Loop 
    while (have_posts()) : the_post(); 
    ?> 
     <div id="<?=get_the_ID()?>"><?=get_the_content()?></div> 
    <?php 
    endwhile; 
?> 
+0

ニース、ありがとうございます:) – tomexsans

関連する問題