I inserted a gallery into a post of mine on WordPress but when I view the gallery on the website it comes up like this:
I’ve made the post go to a certain page of the website in the code:
<?php
$post_id = 5;
$queried_post = get_post($post_id);
echo $queried_post->post_content;
?>
could this affect it?Why does this happen? How can I fix this?
(I’ve also discovered for any shortcodes it does the same thing)
Thanks
For that you can use the WordPress Loop as they are in default or another way is you have to use like
add_filter('the_content', $queried_post->post_content);
. Thanks!