2016-02-23 30 views
1

我有一个链接与我。这是链接:如何在通过wordpress中的url传递时从slug名称获取特定类别的帖子?

http://localhost/rajab/product-category/pvc-hose/

我已经做了一类“PVC管”有塞名称为“PVC软管”,并在页面上显示。当我点击这个类别时,它会转到如上所示的链接。我想在链接页面上显示此类别中的所有帖子。任何人都可以说如何在那里展示它。

+0

我认为这是默认的wp .add一些职位,他们显示在这个页面 –

回答

0

只需创建一个taxonomy.php文件在你的根文件夹下面的代码

if (have_posts()) { 
    while (have_posts()) { 
     the_post(); 

     // Your markup and template tags like 
     the_title(); 
     echo '</br>'; 

    } 
} 
+0

我已经创建了taxonomyyslug.php文件..我已经写了这个代码.. – nnnnnn

0
  <li class="cbp-item houses cbp-l-grid-masonry-height1"> 
          <a class="cbp-caption cbp-lightbox" data-title="PVC Air Hose" href="<?php bloginfo('template_url'); ?>/images/buiding/pvc/img1.jpg"> 
           <div class="cbp-caption-defaultWrap"> 
            <img src="<?php bloginfo('template_url'); ?>/images/buiding/pvc/img1.jpg" alt=""> 
           </div> 

          </a> 
          <h4><?php $data->post_title; ?></h4> 
        </li> 

我想在分类重复这个代码file..I想不仅显示标题和内容,但也是精选图片。

相关问题