所以这让我有点疯狂,我似乎无法让页面导航工作。我安装了一个插件wp-pagenavi,但它仍然无效。有没有人可以帮助我让它工作。这是我的代码(循环):
Mapper.Map(place, placeRealm);
这是我的存档代码:
<?php $args = array(
'post_type' => 'portfolio',
'posts_per_page'=> 10,
'orderby' => 'ID',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'foto_video_type',
'field' => 'slug',
'terms' => 'foto'
)
)
);
$products = new WP_Query( $args );
if( $products->have_posts() ) {
while( $products->have_posts() ) {
$products->the_post();
?>
<?php $naam = get_field('naambedrijf');
$soort = get_field('soort_uitje');
$foto = get_field('flickr_fotoset'); ?>
<div class="col s12">
<div class="title">
<h2 class="truncate" style="line-height:20px;"><?php echo $naam; ?> | <?php echo $soort; ?></h2>
<a class="fotos" href="https://www.flickr.com/photos/../sets/<?php echo $foto; ?>" target="_blank"><small>Bekijk alle foto's</small></a>
</div>
<div class="flickrphotoset">
<?php echo do_shortcode('[slickr-flickr id="" search="sets" set="' . $foto . '" size="large" items="9" bottom="10" responsive="on" type="thumbnail" galleria_options="lightbox:true;thumbnail:lazy"]'); ?>
</div>
</div>
<?php
}
}
else {
echo 'There seems to be a problem, please try searching again or contact customer support!';
} ?>
<?php wp_pagenavi(); ?>
当我添加“旧”Wordpress代码时:
<section id="collaps">
<div class="row">
<div class="col s12 offset-s0 m12 l7 offset-l5">
<ul class="collapsible z-depth-1" data-collapsible="accordion">
<li>
<div class="collapsible-header"><i class="fa fa-camera" aria-hidden="true"></i><p>Foto</p></div>
<div id="portfolio" class="collapsible-body">
<div class="row">
<?php get_template_part('loop-foto'); ?>
<div class="col s12">
</div>
</div>
</div>
</li>
<li>
<div class="collapsible-header"><i class="fa fa-video-camera" aria-hidden="true"></i><p>Video</p></div>
<div id="portfolio" class="collapsible-body">
<div class="row">
<?php get_template_part('loop-video'); ?>
</div>
</div>
</li>
</ul>
</div>
</div>
</section>
它有点工作。但是页面/ 2 /给出了404错误......我做错了什么?
答案 0 :(得分:0)
我不确定这是不是你的情况,但是当我遇到类似的情况时,我会在这里发布我的解决方案:
在我的情况下,问题是我的页面的永久链接等于帖子类型,所以只需更改页面slug就可以解决问题。