Getting two wp_link_pages output

Your theme is using old and deprecated function link_pages to display page-links for paginated posts. Just replace this chunk of code: <div class=”pagelink”><?php wp_link_pages(‘pagelink=Source %’); ?></div> <div class=”format_text”> <?php the_content(‘<p>Read the rest of this entry &raquo;</p>’); ?> <?php link_pages(‘<p><strong>Pages:</strong> ‘, ‘</p>’, ‘number’); ?> </div> with this: <div class=”format_text”> <?php the_content(‘<p>Read the rest of this entry … Read more

WordPress post/page pagination (page links) to go back to the first section

If we want to add a First page link between Previous page and Next page links: Pages: Previous page First page Next page then we could use the wp_link_pages_args, wp_link_pages and wp_link_pages_link filters. Here’s one such example: Example First we check the next_or_number attribute to see if the next mode is active: add_filter( ‘wp_link_pages_args’, ‘wpse_initialize’ … Read more

wp_link_pages output appears twice

you need to set the ‘echo’ parameter of wp_link_pages() to ‘echo=0’; example: $content .= ‘<div class=”pagination”>’ . wp_link_pages(‘before=&after=&next_or_number=next&nextpagelink=Next&previouspagelink=Previous&echo=0’) . ‘</div>’;

wp_link_page – wrap current page element

I wouldn’t use WordPress’ internal function. We had a very similar question recently: How to style current page number (wp_link_pages)? I wrote a small but flexible function to replace wp_link_pages(). It is probably easier to extend this than hacking around the return value of the native function.

How to ignore or disable nextpage tag?

You can try to use the the_post filter, to override the content pagination, that takes place within the setup_postdata() function ( PHP 5.4+ ): /** * Ignore the <!–nextpage–> for content pagination. * * @see http://wordpress.stackexchange.com/a/183587/26350 */ add_action( ‘the_post’, function( $post ) { if ( false !== strpos( $post->post_content, ‘<!–nextpage–>’ ) ) { // Reset … Read more

the_content and wp_link_pages

I guess you have: the_content(); wp_link_pages(); in your theme file. So you can instead try the following (PHP 5.4+): /** * Append the wp_link_pages to the content. */ ! is_admin() && add_filter( ‘the_content’, function( $content ) { if( in_the_loop() ) { $args = [ ‘echo’ => false ]; // <– Adjust the arguments to your … Read more

How to get a page url by a page id?

You’re probably getting that error because WordPress doesn’t have the $wp_rewrite global loaded yet for some reason. Either something deactivated it, or you’re trying to run those functions before WordPress has a chance to load it. If you’re trying to do this in a plugin or in your theme’s functions.php file, make sure you’re inside … Read more

Single Page View for Paginated Posts

Yes, it is possible, and I use it on my own site. Here it is in action: my Settings API post is paginated, but can viewed on a single page, using the “Single-Page View” link. First, you need to prepare a custom query variable, e.g. in functions.php, add the following: function cbnet_parameter_queryvars( $qvars ) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)