title: Previous Next Shortcode for custom post type in Wordpress
body: <p>I'm trying to create a shortcode for a custom post type (project) in wordpress, which should be used inside the content/tinymce field. Right now the prev/next link output only shows up on top of the content. I've already changed echo to return, but this did not solve the issue. What am I doing wrong? Thanks :)</p>
  
  <pre><code>function custom_prev_next_post_nav($atts, $content = null) { 
  if ( ! is_singular( 'project' ) )  return;
  $pnstring = '&lt;div id="prev-next"&gt;'; 
  $pnstring .= previous_post_link( '%link', 'Previous' );
  $pnstring .= next_post_link( '%link', 'Next' );
  $pnstring .= '&lt;/div&gt;';
  return $pnstring; 
  }
  add_shortcode( 'prevnext', 'custom_prev_next_post_nav' );
  </code></pre>