When you programmed the shortcode, how did you do the output?
Like this:
echo "<p>My content goes in here.</p>";
echo "<p>This will display before everything else on the page.</p>";
Or like this:
$content = "<p>My content goes in here</p>";
$content.= "<p>This will display where the shortcode is placed.</p>";
return $content;
I’ll give you a big tip – The second one is right, and the first one is wrong. With that in mind I’m guessing that you’ve done it the first way. Change that and you’ll have it right.
The reason for this is that any output from a shortcode is, well – output, before the pages content is created, so if you use standardecho
statements in a shortcode it will output your content right at the start of the page no matter where the shortcode is in the content.