Pagination-url on frontpage, but no pagination visible or available
I have some projects, one of them is https://mhe.dk, where a customer has events, made with a custom post-type.
If you visit the program-page (https://mhe.dk/program), you have some pagination that makes it possible to see all events on different pages (instead of one long one), just like a normal WordPress archive with pagination.
Now one of my customers came back with some SEO-things, where one of them was the fact that the main page also has the /page/2
possibility, even though there’s no pagination (or even a page 2 etc.) on the frontpage. So one can visit https://mhe.dk/page/2, /page/3 up to 5, and just land on the front page.
What could be triggering this “pagination”, without there being pages?
Below is the code for the front page. The events get loaded in after <!-- Popular Events -->
, where I pull 12 events out of the database. All 12 are displayed on the front page, so there would not be any hidden pagination.
<?php
global $BWPS;
//get_template_part('templates/content', 'header');
if (is_front_page()):
?>
<div class="container">
<div class="slider">
<?php
if (function_exists('masterslider')) {
masterslider(2);
}
?>
</div>
</div>
</div>
<div class="searchBar">
<div class="container">
<form class="search-form form-inline" action="<?php echo site_url('/'); ?>" method="get" role="search">
<label class="sr-only"></label>
<input class="searchInput" type="search" required="" placeholder="<?php _e('Search for event', 'mhe') ?>" name="s" value=""></input>
<button class="searchButton" type="submit"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> <span class="searchButtonText"><?php _e('Search', 'mhe') ?></span></button>
</form>
</div>
</div>
<div class="container">
<div class="container">
<!-- Popular Events -->
<div class="row">
<div class="thumbnail-event">
<?php update_option('title', __('Most popular right now', 'mhe')) ?>
<?php update_option('listing', array('Popular', 12)) ?>
<?php get_template_part('templates/content', 'header'); ?>
<?php get_template_part('templates/content', 'events'); ?>
<?php delete_option('title'); ?>
</div>
</div>
<!-- CTA -->
<div class="row">
<div class="thumbnail-event fp-cta">
<?php dynamic_sidebar('frontpage-cta'); ?>
</div>
</div>
</div>
<?php endif; ?>
Leave an answer