こんにちは、私はWordPress Developmentには初めてです。私はプロジェクトリストが表示されている "プロジェクト"のカスタムポストタイプを作成しました。私は単一のページ(single-project.php)にボタン "Back to Projects"を置いて、リスティングページにリダイレクトします。どうやってやるの?コードの最後の行を見てください。助けてください。単一のページからリスティングページに戻る
if ($query->have_posts()):
while ($query->have_posts()):
$query->the_post();
?>
<div class="related-project-single">
<?php the_post_thumbnail('image_size_720_680'); ?>
<div class="wrapper-button">
<a class="bp-button bp-button-plain button-yellow btn-slider" href="<?php the_permalink(); ?>"><?php echo esc_html__('view project','inspiry') ?> <i class="fa fa-chevron-right"></i></a>
</div>
<div class="wrapper-location">
<h3><?php the_title(); ?></h3>
<?php
$feature_location_related = get_post_meta(get_the_ID(),'bp-location',true);
if(!empty($feature_location_related)){
?>
<p class="featured-location"><?php echo esc_html($feature_location_related);?></p>
<?php
}
?>
</div>
</div>
<?php
endwhile;endif;?>
<a href="">Back to projects</a>
を動作するはずです。 ページングされている場合は、ページ番号をセッションに保存して変数を作成することができます。このようにhref = "index.php/projects/<?php echo $ pageNumber?>"(リンク構造) – Stender