WordPress.org

Ready to get started?Download WordPress

Forums

Parameters Not Working in wp_link_pages (6 posts)

  1. ubergiant
    Member
    Posted 5 years ago #

    I'm trying to get the next and previous pages working for paginating posts with wp_link_pages (see http://codex.wordpress.org/Template_Tags/wp_link_pages ).

    However, nextpagelink and previouspagelink parameters do not work. They are suppose to default to "Next" and "Previous", but nothing shows, even when I define them. All that shows is "1 2 3" etc.

  2. ubergiant
    Member
    Posted 5 years ago #

    This still doesn't work in 2.7. Can anyone provide a working example because I'm thinking it's a bug.

  3. jmckinnell
    Member
    Posted 5 years ago #

    I'm having the same issue. And just with the default function itself. No parameters.

  4. ubergiant
    Member
    Posted 5 years ago #

    Can anyone use all of the parameters in wp_link_pages?

  5. Ovidiu
    Member
    Posted 5 years ago #

    well, it works here, but this template tag:

    <?php wp_link_pages('before=<p class="pagebar">Seiten: &after=</p>&next_or_number=number'); ?>

    gives me this output:

    <p class=\"pagebar\">Seiten: <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/">1</a> 2 <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/3/">3</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/4/">4</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/5/">5</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/6/">6</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/7/">7</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/8/">8</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/9/">9</a> <a href="http://www.rum-reisen.de/reiseberichte/uruguay-florianopolis/10/">10</a></p>

    why this: <p class=\"pagebar\"> that part is obviously broken :-(

  6. mugger
    Member
    Posted 5 years ago #

    I can't tell whether it's working in 2.8 or not, because I don't know exactly how to set it up. Please provide an example of what to place in Page-Editor and/or a template.php. I want a long page to be in convenient sections without hardcoding links to separate pages.

    I just realized that page.php has wp_link_pages, as shown below, so why can't I just insert some sort of <!--nextpage--> tag? ... Nothing happens.

    <?php get_header(); ?>
    
    	<div id="content">
    	<div class="entry">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.