I think it is your fault(or your theme), cuz you are calling “THE_CONTENT()” before the loop start.. so your “echo” always show up at the start of the loop..
Plugin Author
Matt
(@sksmatt)
Hi gggt,
You should return the strings too. Consider returning a custom variable with the collection of your output. This is the way to get your code on the right place:
$out = "Starting my output";
$out .= " Adding another string";
return $out;
Kind Regards!
I dont understand how to get this working.
I am using the below code to show some posts.
query_posts('category_name=breaking-news');
How do I get the post to show where the shortcode is placed in the content?
like gggt mine shows at the bottom.
Plugin Author
Matt
(@sksmatt)
Hi Thesahe,
Same as above, return a custom variable with the collection of your output. Return is a language construct used to exit a function and give a value to the caller of the function[.].
In this case the shortcode function.
Kind Regards!
Thread Starter
gggt
(@gggt)
Just for the sake of an explicit FAQ, sksmatt is right (as you’d expect): If output is going to an unexpected place, most likely you’re using echo for output instead of collecting all your html into a variable and passing it back at the end with return (see sksmatt’s example).
Plugin Author
Matt
(@sksmatt)
Hi gggt,
Thanks for helping explain it, much appreciated.
Kind Regards!