Title: Shortcode function returns looping
Last modified: August 21, 2016

---

# Shortcode function returns looping

 *  [odanicola](https://wordpress.org/support/users/odanicola/)
 * (@odanicola)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/shortcode-function-returns-looping/)
 * Hi There,
 * I made a shortcode function to show the wp_link_pages() on every post pages.
 * This is my code :
 * function showing_page() {
    $pagenation = wp_link_pages( array( ‘before’ => ‘<
   div class=”page-link”><div class=”fl”><span>Page: </span>’, ‘after’ => ‘</div
   ></div>’,’previouspagelink’ => ‘<<‘) ); return ““.$pagenation.”“; } add_shortcode(‘
   showthepage’, ‘showing_page’);
 * I put the shortcode [showthepage] before tag ‘<!– nextpage –>’ and the last of
   the article.
    But the result shows me double page links, On top of the article
   and on the bottom of the article.
 * I want them positioned on the bottom of every pages not on the top.
 * Can you please tell me how to make it? I am not good at wordpress codes. Thanks.

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/shortcode-function-returns-looping/#post-4864602)
 * to get the function to return a string, you need to set the `'echo'` parameter
   accordingly;
 * [http://codex.wordpress.org/Function_Reference/wp_link_pages](http://codex.wordpress.org/Function_Reference/wp_link_pages)

Viewing 1 replies (of 1 total)

The topic ‘Shortcode function returns looping’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/shortcode-function-returns-looping/#post-4864602)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
