Adding range to wp_link_pages()
Adding range to wp_link_pages()
Adding range to wp_link_pages()
Adding wp_link_pages to a theme that seems to lack?
Add query string to wp_link_pages links
It makes all pages show “NEXT PAGE”, because you don’t tell it that it should be any different. What you need is to set that link conditionally based on which page is currently displayed: wp_link_pages( array( ‘before’ => ‘<div id=”slideshow”>’, ‘after’ => ‘</div>’, ‘next_or_number’ => ‘next’, ‘previouspagelink’ => ‘<span id=”previous” style=”display:none;”> PREVIOUS SLIDE </span>’, ‘nextpagelink’ … Read more
wp_trim_words() does not work with my code Am I doing any mistake in my code?
You’ll have to prepare your own custom function instead of wp_link_pages to use in single.php file of your template. Here’s the custom function my_wp_link_pages proposal (contains original wp_link_pages code with commented out lines): function my_wp_link_pages($args=””) { $defaults = array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, /*’next_or_number’ => … Read more
First, I would add a string formatting placeholder to ‘link_before’, like so… $args[‘link_before’] = ‘<span class=”classlinks %s”>’; Next, I would use sprintf() to insert an appropriate class for the appropriate link (let’s assume the classes will be ‘link-before’ and ‘link-after’, respectively). Like so… if($page-1) // there is a previous page $args[‘before’] .= ‘ ‘. _wp_link_page($page-1) … Read more
For posts is set up by loop (see setup_postdata()) it is split into parts and array of those parts is assigned to global $pages variable. Even if it’s not paginated this is still where data goes. Then that variable is actually where get_the_content() looks for post content to process and output, not actual post object. … Read more
I’m not sure why it’s not working. Did you try with the defaults but only changing the “page” and clearing the before/after? wp_link_pages( array( ‘before’ => ”, ‘after’ => ”, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘next’, ‘separator’ => ‘ ‘, ‘nextpagelink’ => ‘Next page’, ‘previouspagelink’ => ‘Previous page’, ‘pagelink’ => ‘%’, ‘echo’ … Read more
The pagination query var on singular posts is page, not paged. echo get_query_var( ‘page’ );