@Rarst Not sure if it helps but you need to use htmlspecialchars if you want to output what is otherwise considered html tags when using an echo statement, echo(htmlspecialchars( '<?= hi ?>' )); in source = <?= hi ?>
@kaiser Awesome, just what I needed for comparison chart... I was thinking how to handle large comparisons with many columns on smaller view-port just couple hours ago... this pretty much nails it
@Trufa First: We see this chat mostly as recreational place and nothing for drive-by questions. But to give you a route to go: Take a look at the template hierarchy, in detail: page.php. Then add a loop and on whatever page you are, the loop will display/give you the data for the current request.
@kaiser thanks! I like to come to the chat and ask quick questions, my intention is not "drive by" :), rather improve the question i will post, or don't post if it was really silly
> Then add a loop and on whatever page you are, the loop will display/give you the data for the current request
@kaiser so I produce a my little pony theme and the client wants a pony widget
but widgets go in plugins no?
so I separate it out
if I keep it in my theme sure it works for that theme
but by separating it out into a plugin it becomes more robust as I have to account for it being used in other themes
so first things first, I style it up in my themes css
but now its fugly in other themes, twentyten users who love ponies are screaming murder hides
so for everyone else, generic basic styling
fewest assumptions
I can put the rainbow gradients in the mylittlepony theme
and all those bells and whistles
if that twentyten user wants a portrait of their favourite pony as the background then yeah, have that, ( in your theme )
or provide a pretty styling/css but with the option to override it via theme like BBPress etc
I think the aim being that if the client really wants, they should be able to change their theme to twentyten or twentytwelve or whichever theme, and everything should still work
it might look like crap, but functionally its in a usable state
that way if new developer (( e.g. you )) comes along and builds a new theme, they get to keep all their data, and all their widgets, and you need only restyle my widget plugins
Current example, as I'm looking at my latest widget that displays a single image along with its caption: I got the ability to choose between custom or built in (a.k.a. theme dependent) sizes. Alongside that, I question if one wants to use the built in caption, description or a custom caption (which can be made empty). Now what if the caption doesn't fit? display:none;? lol
I mean, ok - from the internals of dynamic_sidebar() this simply isn't possible. From a developer perspective this is just too close to end user requirements, alias: fire and forget or eat what's on the table. Need other MarkUp, grab other plugin.
Hm. Maybe I could do a get_template_part( apply_filters( 'widget_image_template', '' ) ); call in the widget :D
@TomJNowell Simplified: Display an image along with its caption.
I work a lot of with filters/hooks and I really like them. But when you got dozens of callbacks and have conditionals invoked, then there comes this point where using filters is obfuscating problems...
Not talking about a single plugin, but about a middle-heavy complex site/theme.
Ah, it should be get_template_part( apply_filters( 'widget_image_template', '', $data ) ); so one can access it in the template... or so.
you could put that in a function and attach to an action which you then call when you need to output, pass in param etc, still gives you the ability to unhook it etc etc you get the picture
just do what works and refactor as and when you need to