Hi,
The current PHP support is an either/or setting. In other words, when enabling PHP, it expects the entire snippet to be in PHP. It’s on my list of possible future enhancements though, to add more flexibility for allowing a mix and match approach.
In the meantime, a workaround would be to wrap the html parts of your html/php snippet in echo ”; statements.
Cheers,
Johan
How would I create a snippet like this:
text before, [commentout]blah, blah, blah, [/commentout]text after
I want it to be either HTML or PHP comment of text in the WYSIWYG editor.
So the example shortcode above would output to the front-end page: “text before, text after”.
I’d prefer it to be PHP commented out, not HTML (since that would still be viewable in “view source” mode), but I’ll take what I can get.
Thank you for the help.
(@coffeepostal)
14 years, 1 month ago
Hello, first of all, thank you for the plugin, it’s fantastic!
I’m hoping that I’m just being dense, but I’m hoping I can use the
<?php bloginfo('template_directory'); ?>tag inside of a snippet, and it doesn’t seem to like it.I’m creating a Shortcode for my snippet, and if I tick the PHP box, it doesn’t like the, mostly, HTML code in the snippet, and if I leave in unchecked, than it renders out the PHP tag as text.
Any ideas?
http://ww.wp.xz.cn/extend/plugins/post-snippets/