I am using custom shortcode to show some message at the end of the post. I am finding it hard to do so because it shows up at the top of the post. Here is my code.
I am placing the shortcode at the end of the post but the message appears at the top of the post.
What should I do to fix this?
function hello_kitty(){
if ( is_single() ){
echo 'This is hello Kitty message';
}
}
add_shortcode('hellokitty',hello_kitty);
Shortcodes are supposed to return your html, not echo it.
Make sure you check the documentation on the Shortcodes API
http://codex.wordpress.org/Shortcode_API