I am using twentyfifteen theme and for pagination , i have used the_posts_pagination and want to remove h2 tag and text
I have tried but it just remove "Post navigation"text,not h2 tag
the_posts_pagination( array(
'prev_text' => __( ' ', 'twentyfifteen' ),
'next_text' => __( ' ', 'twentyfifteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( '', 'twentyfifteen' ) . ' </span>',//Page
'screen_reader_text' => __( ' ' )
) );
Pl help me. Thanks
You mentioned wanting to remove the h2 tag and text. But for accessibility it is helpful to keep the h2 with class screen-reader-text
.
This WordPress article on accessibility shows how to hide the Post navigation
text visually but keep it available to screen readers.
/* Text meant only for screen readers. */
.screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With