Archived topic
& turning into & amp ; in shortocodes
9 replies · Started by Carlo on June 30, 2021
Hi there,
I have got this issue when inserting shortcodes.
For example:
let's take this one
[wp_show_posts id="10150" settings="meta_key=id_number&orderby=meta_value&order=ASC"]
After saving the page, the shortcode is working.
But If I go back to edit the same page, the shortcode is turned into this one:
[wp_show_posts id="10150" settings="meta_key=id_number& amp ;orderby=meta_value& amp ;order=ASC"]
As you can see & is changed to & amp ; (I had to add blank spaces otherwise I could not make this appear in this message :) )
And if the page is saved again, the shortcode does not work anymore.
Is there some solution to fix this? (maybe some snippet to put in functions.php?
Thank you. All the best. Carlo
Hi there,
how are you adding the shortcodes in the editor ? Are you using the Shortcode Block ?
yes
Not come across this before but it looks like a bug in Gutenberg:
https://github.com/WordPress/gutenberg/issues/26362
Try adding the shortcode using a HTML block instead.
Just tried.
Same issue unfortunately
Are those arguments required in the Shortcode ? Could they be included in the WPSP list settings ?
I can consider to create multiple lists with a different filter each.
As you can see, the key is a custom field (created in ACF)
is it possible?
The only option i can think is to create your own shortcode that passes your arguments to the wpsp_display function.
Here's an example of that being done here:
https://wpshowposts.com/support/topic/category-specific-side-bar/#post-31332
If you need help with that - it would be worth raising a topic on the WPSP forum
Hi David,
thank you for your support. I hav just raised a topic on the WPSP forum.
This is the link: https://wpshowposts.com/support/topic/snippet-to-convert-a-shortcode/
Thank you. Have a nice day. Carlo
Thanks - we'll get onto that ASAP.