I'm trying to insert a shortcode as the last item in a menu but it results in creating the <li> but then throwing the shortcode output elsewhere, outside of the list. It also removes the closing <li> for that menu item?

Moderators: Please remove this question as I will be throwing it over to StackOverflow. Thank you
–
iCeRFeb 28 '12 at 23:15

Actually, I can just move this over tho SO for you ... would you rather have me delete it or migrate it?
–
EAMann♦Feb 29 '12 at 5:53

@EAMann: EAMann, thank you! Probably best that the other one is deleted or migrated, it seems that Jared has provided an answer that I will accept. Just about to test it :) Thanks!
–
iCeRFeb 29 '12 at 6:44

If you've already got a good answer here, there's no need to migrate! :-) Good luck!
–
EAMann♦Feb 29 '12 at 14:51

Edit:On another note, this is merely a PHP question, such questions should be asked at StackOverflow.

Edit 2: In regards to your last edit on your question, shortcode functions need to return data, not echo it, this is what is causing the issue. You would need to take everything you are echoing and put it into a variable instead, and then return that variable (which contains the HTML code you want to output).

Thank you Jared! You're right- just thought it would have something to do with the genesis framework. It worked, however not quite as it should, as it doesn't insert the shortcode output in the <li>, rather outside of it? I'll update my questions now..
–
iCeRFeb 28 '12 at 9:08

@iCeR The new problem that has risen from this may in fact be a WordPress question. Can you update your question with the function that displays the [shopping_cart] shortcode?
–
JaredFeb 29 '12 at 3:41

Sure! Placing it in there now. You will find my commented out code where I stripped all styling so it just echo's the variable..
–
iCeRFeb 29 '12 at 5:07