WordPress.org

Ready to get started?Download WordPress

Forums

This a bug? wp_link_pages (1 post)

  1. jamesbe
    Member
    Posted 5 years ago #

    I am not sure if this is a bug or I'm using it incorrectly.

    In wp_link_pages the option to have "next" instead of "number" doesn't put any type of spacing between "Previous Page" and "Next Page" so it looks bad. The page ends up with <<Previous Page Next Page>> all squished together.

    I added a new field called "between" into this function to allow it to put spaces -- by default I set it to to 2 spaces but you could pass the option to have 3 spaces. It makes it much cleaner.

    function wp_link_pages($args = '') {
            $defaults = array(
                    'before' => '<p>' . __('Pages:'), 'after' => '</p>',
                    'link_before' => '', 'link_after' => '',
                    'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
                    'previouspagelink' => __('Previous page'), 'pagelink' => '%',
                    'more_file' => '', 'echo' => 1, 'between' => '&nbsp;&nbsp;'
            );

    I then put the code in the proper location in the function to only add the space if there is both a previous and next output. Should I raise a ticket on this and submit a fix?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.