-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
64 lines (52 loc) · 1.38 KB
/
functions.php
File metadata and controls
64 lines (52 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* Theme functions.
*
* @package TheWebSolver\Codegarage\Function
*/
namespace TheWebSolver\Codegarage;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
require __DIR__ . '/Includes/Bootstrap.php';
// Load main file.
Bootstrap::load()->platform( __DIR__, 'theme' );
/**
* Load project related files and start.
*
* @see Bootstrap::class()
* @see Bootstrap::start()
*/
/**
* Gets pagination text and arrows.
*
* @return string
* @since 1.0.0
*/
function number_pagination() {
global $wp_query;
// Bail early if only one page.
if ( $wp_query->max_num_pages < 2 ) {
return '';
}
// Show pagination for pages with same category.
$args = array(
'prev_text' => '<span class="tws-whitelabel-left-arrow">←</span> ' . __( 'Previous Page', 'tws-codegarage' ),
'next_text' => __( 'Next Page', 'tws-codegarage' ) . ' <span class="tws-whitelabel-right-arrow">→</span>',
'taxonomy' => 'category',
'in_same_term' => true,
);
ob_start();
?>
<div class="tws-whitelabel-pagination">
<?php the_posts_navigation( $args ); ?>
</div>
<?php
/**
* WPHOOK: Filter -> Pagination HTML markup.
*
* @param string|false $content The content.
* @var string|false
*/
$content = apply_filters( 'tws_codegarage_pagination_markup', ob_get_clean() );
echo $content ? $content : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}