alternative to wp_link_pages() that only shows link to last page

Crib a bit of code from wp-includes/query.php and bit from wp-includes/post-template.php, add a little, mix and stir, and… function url_to_last_page() { global $post; $content = str_replace(“\n<!–nextpage–>\n”, ‘<!–nextpage–>’, $post->post_content); $content = str_replace(“\n<!–nextpage–>”, ‘<!–nextpage–>’, $content); $content = str_replace(“<!–nextpage–>\n”, ‘<!–nextpage–>’, $content); $pages = explode(‘<!–nextpage–>’, $content); $numpages = count($pages); $ret = _wp_link_page($numpages); $ret .= $numpages; $ret .= ‘</a>’; return … Read more

How to ignore wp_link_pages function?

wp_link_pages has two filters you can use: The wp_link_pages_args filter is passed the $args for wp_link_pages so you could set echo to false. The wp_link_pages filter is passed the output so you could set the output to nil. Something like this should work: /** * Filter the HTML output of page links for paginated posts. … Read more

Make Current/Active Page Number a Link (WP_LINK_PAGES)

Doesn’t look like there are proper hooks to modify the output as per your requirements. But you could write a function similar to wp_link_pages() and call that in your theme. The following function would do your trick. function custom_link_pages($args=””) { $defaults = array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ … Read more

Make wp_link_pages() suitable for Twitter Bootstrap markup

There was a trac ticket requesting improvements to the function since it was inflexible, yet required for themes hosted in official repository. It had been resolved, adding much needed wp_link_pages and wp_link_pages_link filters, so now output can be cleanly modified without need to use custom function. I went through quite a few takes on this … Read more

How to customize wp_link_pages()?

You can use next_or_number param of wp_link_pages to achieve this. From Codex: next_or_number (string) Indicates whether page numbers should be used. Valid values are: number (Default) next (Valid in WordPress 1.5 or after) Then you can use nextpagelink and previouspagelink params to modify these links texts. So doing it like this should do the job: … Read more

Post Pagination Modifications (wp_link_pages)

This code should help you achieve what you want to, if you swap the code below <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link-next-prev”>’, ‘after’ => ‘</div>’, ‘next_or_number’ => ‘next’, ‘previouspagelink’ => __(‘Previous’), ‘nextpagelink’=> __(‘Next’) ) );?> With this code <?php global $page, $pages; // This shows the Previous link wp_link_pages( array( ‘before’ => ‘<div class=”page-link-next-prev”>’, … Read more

PHP code to use on next & previouspage links

adjust the ‘nextpagelink’ and ‘previouspagelink’ arguments for wp_link_pages() to have a css class you can style $args = array( ‘nextpagelink’ => ‘<span class=”next”>’ . __(‘Next page’) . ‘</span>’, ‘previouspagelink’ => ‘<span class=”prev”>’ . __(‘Previous page’) . ‘</span>’ ); wp_link_pages($args); then in your css you can style those spans to use your arrows as background images.

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