Services Plugin Shortcode position on page

ForumCategory: PluginsServices Plugin Shortcode position on page
cwjordan asked 1 year ago

I noticed when using the Services Plugin’s [upcoming-services] shortcode that it will put the list of upcoming services before any content on the page.  That is, if I have:

<p>This should be the first line</p>

Then the list of upcoming services is displayed above the line that says “This should be the first line” instead of below it.  That doesn’t seem to be desirable behavior, perhaps it could be fixed in a future plugin update?
Looking at upcoming-services-shortcode.php this may be a problem there.  The function uuaservices_shortcode_upcoming_services is producing output instead of returning a value.  The WordPress Codex says that “Shortcode functions should return the text that is to be used to replace the shortcode” and that “Producing the output directly will lead to unexpected results”.

cwjordan replied 1 year ago

Oh, sadly, but not unexpectedly, there is the same problem with the [service-archive] shortcode

1 Answers
Margy Levine Young Staff answered 5 months ago

Does the updated Services plugin fix this?

cwjordan replied 5 months ago

Thanks for reminding me to check. I double checked the code to be sure and they did fix it, and it works correctly now on my site.