2012-03-08 21 views
0

私のブログにビデオと呼ばれるカスタムポストタイプがあります。右側にカスタムポストタイプが間違ったカテゴリとタグを取得する

enter image description here

は左に、カスタムポストタイプから最新のポストされている以下のsceenキャップがあり、ビデオで、ビデオの下に日時、カテゴリやタグでいます。 しかし、問題は、それが間違っている、タグ、カテゴリ、および日付です。 どうすれば修正できますか?グローバル$post変数を上書き

$queryObject->the_post(); 

:ここ

は、私はあなたの問題がダウンしてこの呼び出しにあると思い

<?php 
/* 
Template Name: Single Videos 
*/ 
?> 
<?php get_header() ?> 

<div id="wrapper"> 

<div id="container"> 

<div id="contentfull"> 



    <?php the_post() ?> 

     <div class="entry-wide"> 
      <center><h2 class="page-title2"><?php the_title() ?></h2>  </center> 

      <div class="entry-videoo"> 
<?php the_content() ?> 



<?php wp_link_pages('before=<div class="page-link">' . __('Pages:', 'wpbx') . '&after=</div>') ?> 


      </div> 

<div id="videosidebar"> 

<?php 
$queryObject = new WP_Query('post_type=videos&posts_per_page=2020&orderby=rand'); 
// The Loop! 
if ($queryObject->have_posts()) { 
?> 

<?php 
while ($queryObject->have_posts()) { 
    $queryObject->the_post(); 

    ?> 

<table width="100%" border="0" cellspacing="0" cellpadding="0"> 

<tbody> 

<tr> 

<td valign="top" width="1%"> 
<div id="videoimg"><a href="<?php the_permalink(); ?>" title="<?php printf(__('Read %s', 'wpbx'), wp_specialchars(get_the_title(), 1)) ?>"> 
        <?php the_post_thumbnail('video-post'); ?> 
        </a></div> 
</td> 

<td valign="top" width="90%"> 
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> 
</td> 

</tr> 


</table> 
<?php 
} 
?> 
<?php 
} 
?> 
</div> 

<div class="entry-info"> 

<div class="entry-meta-top"> 
        <span class="entry-date"><font color="#e60288"><b><?php the_time(__('F jS, Y', 'kubrick')) ?></b></font></span> 
        <span class="entry-meta-sep">|</span> 
        <span class="entry-cat">Published in: <?php the_category(', '); ?> </span> 


<div id="sharing"> 
<span class='st_facebook_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_twitter_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_plusone_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span></div> 
      </div> 

<br> 
<?php the_tags(__('<span class="tag-links"><strong>More On:</strong> ', 'wpbx'), ", ", "</span>\n") ?> 


<div class="entry-content"> 
        <?php the_excerpt(); ?> 
       </div> 


</div> 

<div class="entry-commm"> 

<?php comments_template(); ?></div> 


     </div><!-- entry --> 





</div><!-- #contentfull --> 
</div><!-- #container --> 
</div><!-- #wrapper --> 

<?php get_footer() ?> 

答えて

0

以下、そのテンプレートのページのコードです。その後の(例えば)the_title()への呼び出しでは、そのループの値が使用されます。カスタム投稿自体は使用されません。 (すなわち<div class="entry-info">前)$queryObjectループの後、あなたのPHPコードで

wp_reset_postdata() 

を追加してみてください。

tbodyタグを閉じないでください - 生成されたHTMLをthe w3c validatorで実行して問題を修正してください。今後ヒットするCSSの問題を解決するのに役立ちます。

関連する問題