Skip to content

Commit 1afad20

Browse files
committed
Bugfix: cpt_next_posts_link correct link for a standard archive
1 parent 6ff0c3a commit 1afad20

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

assets/js/load_more.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ function initLoadMore() {
1010
loading = true;
1111
var $loadmore = jQuery(this),
1212
link = $loadmore.attr('href'),
13-
pagecount = $loadmore.attr('data-pagecount'),
14-
selector = $loadmore.attr('data-selector'),
15-
container = $loadmore.attr('data-container') || selector;
13+
pagecount = $loadmore.data('pagecount'),
14+
selector = $loadmore.data('selector'),
15+
container = $loadmore.data('container') || selector;
1616
jQuery.post(
1717
link,
1818
{

framework/Objects/Post_Type.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ abstract class Post_Type {
112112
* IF has_singular == false AND is_searchable == true THEN we need to redirect page from search results to some other page
113113
* custom property: auto-redirect to some URL
114114
*
115-
* @var false|string
115+
* @var boolean|string
116116
*/
117117
protected $redirect = false;
118118

@@ -169,7 +169,7 @@ abstract class Post_Type {
169169
*/
170170

171171
/**
172-
* Taxonomy slugs to add to this CPT, will be used only for standard Category and Tags.
172+
* Taxonomy IDs to add to this CPT, will be used only for standard Category and Tags.
173173
* All other custom taxonomies should register CPT they are used inside the Taxonomy
174174
* affect: taxonomies
175175
*

framework/Objects/Singleton.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
* Singleton design pattern base class
88
*/
99
trait Singleton {
10-
/**
11-
* Refers to a single instance of this class.
12-
*
13-
* @var self
14-
*/
15-
protected static $instance = null;
16-
1710
/**
1811
* Returns the *Singleton* current class.
1912
*

framework/helpers.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ function cpt_next_posts_link( WP_Query $wp_query, $label, $load_more_attr = '' )
5959
$paged = $wp_query->query_vars['paged'];
6060
$max_page = $wp_query->max_num_pages;
6161

62+
// on default post list we have empty $paged, so need to set into 1.
63+
if ( ! $paged ) {
64+
$paged = $wp_query->query_vars['paged'] = 1;
65+
}
66+
6267
$nextpage = intval( $paged ) + 1;
6368

6469
if ( null === $label ) {

0 commit comments

Comments
 (0)