Shortcode for php snippet not working
-
I’m trying to migrate from another plugin to WPCode. I have a PHP snippet that works if I select Auto insert in combination with Run Frontend Only.
However, I would like to use the Shortcode option instead of Auto insert. So I select Shortcode, which gives me [wpcode id=”4334″], which I insert as a shortcode (at the top) on one of my pages.
But then the code snippet no longer works. I have set the priority of the code snippet to 1 and use no conditional logic.
The snippet looks something like:
echo("hello"); add_action( 'wp_head', function () { ?><style>.foo {display:none!important;}</style><?php ...The
hellogets printed, but the styling is not adjusted (which it is with the Auto insert option).Any idea what might be the problem?
The topic ‘Shortcode for php snippet not working’ is closed to new replies.