Skip to main content

Open Files

functions.php
pagination.php
style.css

Folders

wordpress-5.x
htdocs
wp-admin
wp-content
plugins
themes
twentynineteen
twentyseventeen
twentytwenty
assets
classes
inc
template-parts
blocks
content-cover.php
content.php
entry-author-bio.php
entry-header.php
featured-image.php
functions.php
pagination.php
style.css
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$posts_pagination = get_the_posts_pagination(
    array(
        'mid_size' => 1,
        'prev_text' => $prev_text,
        'next_text' => $next_text,
    )
);

// If we're not outputting the previous page link, prepend a
// placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'prev page-numbers' ) === false ) {
    $posts_pagination = str_replace( '<div class="nav-links">', '<div class="nav-links"><span class="prev page-numbers placeholder" aria-hidden="true">' . $prev_text . '</span>', $posts_pagination ) ;
}

// If we're not outputting the next page link, append a
// placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'next page-numbers' ) === false ) {
    $posts_pagination = str_replace( '</div>', '<span class="next page-numbers placeholder" aria-hidden="true">' . $next_text . '</span></div>', $posts_pagination ) ;
}

if ( $posts_pagination ) { ?>

<div class="pagination-wrapper section-inner">

    <hr class="styled-separator pagination-separator is-style-wide" aria-hidden="true" />
style.css
.pagination-wrapper {
  margin-top: 5rem;
  margin-bottom: 5rem;
}

.pagination-separator {
  margin: 4rem 0;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links a,
.nav-links span {
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.3rem;
}

.nav-links a {
  background-color: #fff;
}

.page-numbers.current {
  background-color: #0073aa;
  color: white;
}

.page-numbers.prev,
.page-numbers.next {
  font-weight: bold;
}

.page-numbers.placeholder {
  visibility: hidden;
}
              
Line 1, Column 1
Tab Size: 2
PHP
Find:
Replace: