Hi all!
Thank you very much for sharing great WP themes and the great support. I basically want to know how to place the page pagination very next to content. This means, I used to add a new page with lengthy content and use the <!–nextpage–> to split the page. The pagination works fine, but it is very far beneath to the content. I would like to place the pagination very close to content. Hope someone can help me regarding this modification. Thank you in advance for your response.
PS. Pl.don’t give a Child Theme solution, because I’m not not good with it. I can’t still understand the whole concept of Child Theme.
Thanks & regards
To move post navigation buttons above any other plugin generated content you can do the following steps:
- First remove this part of code from the
content-extensions.php
file
wp_link_pages( array(
'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'travelify' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '%',
'echo' => 1
) );
More specifically look up function called travelify_theloop_for_single
on that files. That’s the function you need to edit.
- Now that you are done with this you should create a filter for
the_content
via functions.php
. Here is function that you should use;
add_filter( 'the_content', function( $content ) {
return $content . wp_link_pages( array(
'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'travelify' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '%',
'echo' => false ) );
}, -1 ); // Lower number = higher priority.