Title: Function
Last modified: August 20, 2016

---

# Function

 *  [winenerd](https://wordpress.org/support/users/winenerd/)
 * (@winenerd)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/function-1/)
 * I have made this shortcode function using the List Category Post plugin in the
   function.
 * I have however a problem, the function works, but the result is displayed in 
   the top of the post, and not where the shortcode is inserted (in the bottom).
 * The function looks like this:
 *     ```
       function btext_func( $atts ) {
            extract( shortcode_atts( array(
                      'category' => 'all',
       ), $atts ) );
       echo '<h3>Tasting Notes for this producer</h3>';
       echo (do_shortcode('[catlist name="'.$category.'" tags=taste numberposts=30 excerpt=no date=yes]'));
       echo '<h3>Related articles</h3>';
       echo (do_shortcode('[catlist name="'.$category.'" tags=article excerpt=yes]'));
       }
       add_shortcode( 'btext', 'btext_func');
       ```
   
 * How can I move the output to the bottom where the shortcode is inserted in the
   post.
 * /winenerd
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button.]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/function-1/#post-2714059)
 * You should never echo the output of a shortcode, You must return it.
 *  Thread Starter [winenerd](https://wordpress.org/support/users/winenerd/)
 * (@winenerd)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/function-1/#post-2714116)
 * Have tried with return, but does not work – sadly.
 * Could you be a bit more specific?
 * /winenerd
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/function-1/#post-2714173)
 * See [Shortcode_API](http://codex.wordpress.org/Shortcode_API).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Function’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/function-1/#post-2714173)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
