File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,27 @@ class WP_Basic_Bootstrap_Pagination
9
9
public $ type = 'simple ' ;
10
10
protected $ entries ;
11
11
12
- public function render ()
12
+ public function render ($ in_category = false )
13
13
{
14
+ $ add_args = [];
14
15
$ this ->entries = array ();
15
16
17
+ $ cats = get_the_category ();
18
+ if (count ($ cats )>0 ) {
19
+ $ add_args ['category__and ' ] = $ cats [0 ]->term_id ;
20
+ }
21
+
16
22
if (is_attachment ()) {
17
23
} elseif (is_single ()) {
18
24
$ this ->entries = array (
19
- 'previous ' => get_previous_post (),
20
- 'next ' => get_next_post (),
25
+ 'previous ' => get_previous_post ($ add_args ),
26
+ 'next ' => get_next_post ($ add_args ),
21
27
);
22
28
23
29
// } elseif (is_archive() || is_search()) {
24
30
} else {
25
31
$ this ->type = 'numerical ' ;
26
- $ this ->get_pagenav_num ();
32
+ $ this ->get_pagenav_num ($ add_args );
27
33
}
28
34
29
35
return $ this ->entries ;
Original file line number Diff line number Diff line change @@ -202,8 +202,10 @@ public static function registerScriptsFrontend()
202
202
$ uri = $ item ['uri-cdn ' ];
203
203
} elseif (strtolower (BASICBOOTSTRAP_ASSETS_LOADER ) == 'npm ' && isset ($ item ['uri-npm ' ])) {
204
204
$ uri = $ item ['uri-npm ' ];
205
- } else {
205
+ } elseif ( isset ( $ item [ ' uri ' ])) {
206
206
$ uri = $ item ['uri ' ];
207
+ } else {
208
+ $ uri = '' ;
207
209
}
208
210
209
211
if (isset ($ item ['replace_original ' ]) && $ item ['replace_original ' ] == true ) {
Original file line number Diff line number Diff line change @@ -271,13 +271,13 @@ function get_the_breadcrumb()
271
271
/**
272
272
* Build pages pagination
273
273
*/
274
- function get_the_pagination ()
274
+ function get_the_pagination ($ post_type = '' )
275
275
{
276
276
basicbootstrap_load_class ('WP_Basic_Bootstrap_Pagination ' );
277
277
$ paginator = new WP_Basic_Bootstrap_Pagination ();
278
278
$ entries = $ paginator ->render ();
279
279
if (count ($ entries )) {
280
- get_template_part_hierarchical_fetch ('partials/pagination/ ' .$ paginator ->type , '' , $ entries );
280
+ get_template_part_hierarchical_fetch ('partials/pagination/ ' .$ paginator ->type , $ post_type , $ entries );
281
281
}
282
282
}
283
283
You can’t perform that action at this time.
0 commit comments