Recipe Shortcode – not working
-
Hello!
I’m trying to update my blog with the recipe shortcode, which I’ve been using for a few months now and love. However, when I preview, my blog isn’t recognizing the end of my recipe with the [/recipe] code, so it just encases the rest of the post in the recipe box as well. I also tried publishing to see if it was just a glitch, but that didn’t work either. Not sure what’s going on – can someone help?
The blog I need help with is: (visible only to logged in users)
-
That is strange. I have never had that issue so I tagged this thread for Staff attention. Please subscribe to it so you are notified when they respond. To subscribe look in the sidebar of this thread, find the subscribe to topics link and click it.
-
Thanks, time thief! I am subscribed to this topic, thank you! The specific post where it’s happening is here: https://whatisthisamateurhour.wordpress.com/2015/02/16/pierogi-project-my-first-time-making-homemade-pierogi/
If you click on my other posts, you’ll see it’s not happening there so I’ve used the shortcode successfully many times. All the posts on my homepage have a recipe except for the Guest Post about CSAs.
I also went into the text tab and compared the code there to the code on successful recipes. I noticed that occurs on the line above [/recipe] so I copied that and added it to the problem post. It didn’t do anything and when I returned to the text tab of the post, it has disappeared.
I hope that makes sense, I really know absolutely nothing about coding!
-
What you did was the way to resolve the issue on a single post but this should not be happening. That is why I am leaving the tagging for Staff up on this thread.
-
Hi @headamateur,
To fix this, we’ll want to remove the following lines from the middle of your post:
<div class="content-block ingredients"> <div class="ingredients-section">Then, at the end of the post, you’ll want to remove the following:
</div> </div>Note: You will need to be in the Text/HTML editor to see this code.
Can you give that a try?
-
It did work! Thank you so much!! I’m not sure how to avoid that in the future – I’m not sure how the problem code got there!
I did copy and paste the recipe from a different website, so that may be the culprit, although I’m not sure how that affected the end on the post and the code you asked me to remove there.
But thank you so much for your help!! It looks so much better now.
-
I believe the copy and paste did have an effect here. The site you copied from likely had some special CSS classes setup (called content-block, ingredients, and ingredients-selection).
In the future, I would recommend using the Paste as Plain Text option mentioned here:
That should strip out any miscellaneous HTML!
- The topic ‘Recipe Shortcode – not working’ is closed to new replies.