I need to be able to display different shortcodes inside custom fields.
I have found a method that almost works perfect, but since that uses get_content
, it also shows the main featured image of the page.
After the image that's output, the correct content that the shortcode outputs is displayed correctly. How can I stop the image from being output in the first place?
I'm using css to hide it, but would rather not have it output at all. I've tried using this other method which used get_the_content
instead, and that doesn't work.
The shortcode content doesn't even show at all with that method.
I also found this:
echo preg_replace("/\< *[img][^\>]*[.]*\>/i","",get_the_content(),1);
Does anyone know how to make that filter work for me with the code I'm using (shown in the pastebin link).