Insert pagination links – wp_link_pages() – before filters on posts

That’s because you have directly edited the single.php file, try to make a function and in it return wp_link_pages() and in add_action set a priority. Try this function function pagination_after_post() { return wp_link_pages(); } add_action(‘the_content’,’pagination_after_post’,1); My WP PHP is not that good, my function might be wrong, this is just an example, but this way … Read more

Can I add a ‘show all pages’ link to wp link pages?

Here’s a suggestion using the wp_link_pages and content_pagination filters: The aim is to add a “Show All Content” link below the content pagination links: and when we click it, the link should display “Show Content Pagination” and vice versa. Demo plugin We can do that with the following demo, where we introduce the wpse_show_all_content GET … Read more

Add a Class to Current Page WP_LINK_PAGES

This is what I use as a replacement for wp_link_pages(). Instead of a separate class it uses another element for the current page, because a page should never link to the current URL. /** * Modification of wp_link_pages() with an extra element to highlight the current page. * * @param array $args * @return void … Read more

wp_link_pages: display current page number only if has multiple page breaks?

The $multipage is constructed inside the setup_postdata() method of WP_Query. It’s called when you run the_post(). So just as @s_ha_dum explained, you have to make a loop around it: You can try this: if( have_posts() ) { the_post(); // Make a call to setup_postdata(). echo sbwp_get_current_chapter(); // Display the current chapter. rewind_posts(); // Rewind back. … Read more

Customizing wp_link_pages

I don’t see a way to do this with just the standard arguments but you can do it with a filter: function link_hack_wpse_($output,$args) { global $page, $numpages; $xofy = $page.’ of ‘.$numpages; if (1 == $page) { $output = str_replace($args[‘after’],” $xofy{$args[‘after’]}”,$output); } elseif ($page == $numpages) { $output = str_replace($args[‘before’],”{$args[‘before’]}$xofy “,$output); } else { $output … Read more

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