1
我已將模板轉換爲WordPress主題,但我的投資組合部分不起作用。我已經做了一個自定義的帖子類型,並添加自定義分類init名稱爲console
。儘管它獲取類別名稱,但點擊類別名稱時卻不顯示與其相關的圖像。投資組合部分不在wordpress中工作
我的代碼是:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$loop = new WP_Query(array(
'post_type' => 'portfolio',
'posts_per_page' => 9,
'orderby'=> 'menu_order',
)); ?>
<section id="work" class="text-center wow fadeInDown" data-wow-delay="2000" style="background-color:<?php echo $theme_options['section2_scheme']; ?>;">
<div class="container">
<div class="center">
<h2><?php echo $theme_options['section3-heading']; ?></h2>
<hr class="skills_hr"/>
<p><?php echo $theme_options['section3-subheading']; ?></p>
</div>
<?php
$taxonomy = 'console';
$post_type='portfolio';
$terms = get_terms($taxonomy); // Get all terms of a taxonomy
if ($terms && !is_wp_error($terms)) :
$counter=0;
?>
<ul class="portfolio-filter text-center">
<?php foreach ($terms as $term) {
$counter=$counter+1;
?>
<li><a class="btn btn-default <?php if($counter==1){echo "active";}?>"
href="#<?php echo $term->slug ?>" data-filter=".<?php echo $term->slug; ?>" >
<?php echo $term->name; ?></a></li>
<?php } ?>
</ul>
<?php endif;?>
<!--/#portfolio-filter-->
<div class="row">
<div class="portfolio-items ">
<?php while ($loop->have_posts()) : $loop->the_post(); ?>
<?php
$category = get_the_category(get_the_ID());
?>
<div class="portfolio-item <?php echo $term->slug; ?> col-xs-12 col-sm-4 col-md-3">
<div class="recent-work-wrap">
<div class="img-responsive">
<?php the_post_thumbnail('post-thumbnail');?></div>
<div class="overlay">
<div class="recent-work-inner">
<h3><a href="#"><?php the_title(); ?></a></h3>
<p><?php the_excerpt(); ?></p>
<a href="#" class="preview" rel="prettyPhoto">
<i class="fa fa-eye"></i> View</a>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<!--/.portfolio-item-->
</div>
</div>
</div>
,我想讓它像這樣
http://responsive.co.il/bedford/featured-works/
它仍然沒有工作 –
我會派另一個文件中,頁面模板,它在工作時,此流程的js文件我pc ....檢查你的郵件 –
當我點擊所有的工作,它顯示所有圖像,但當我點擊其他categries它隱藏所有圖像,當我點擊創意(categry)它隱藏所有圖像 –