Title: wp_link_pages() errors
Last modified: August 19, 2016

---

# wp_link_pages() errors

 *  [miocene22](https://wordpress.org/support/users/miocene22/)
 * (@miocene22)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_link_pages-errors/)
 * I’m using the function wp_link_pages() in my wordpress theme to make the page
   links for multi-paged posts and am coming up against an xhtml validation error.
   The html generated by the function is not encoding the & in the urls. E.g.
    `
   <a href="http://example.com?p=188&page=2">2</a>` should be `<a href="http://example.
   com?p=188&page=2">2</a>`
 * _edit: this forum seems to be unencoding even my coded & symbols. The 2nd example
   should have a `&amp ;` instead of a &. (without the space before the 😉_
 * Here is my code with the function arguments:
 * `<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:',''),'
   after' => '</div>' ) ); ?>`
 * Any ideas as to how I can get it to make valid xhmtl?

Viewing 1 replies (of 1 total)

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_link_pages-errors/#post-1727643)
 * Closest ticket i could find.
    [http://core.trac.wordpress.org/ticket/12126](http://core.trac.wordpress.org/ticket/12126)
 * See the attached patch, i think that’s the source of your issue (with the unencoded&’
   s).

Viewing 1 replies (of 1 total)

The topic ‘wp_link_pages() errors’ is closed to new replies.

## Tags

 * [wp_link_pages](https://wordpress.org/support/topic-tag/wp_link_pages/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/wp_link_pages-errors/#post-1727643)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
