How to only load css for used blocks on frontend

To get separate files for each block you’ll need to bring your own webpack config One as simple as this should work: const defaultConfig = require(‘@wordpress/scripts/config/webpack.config’); module.exports = { …defaultConfig, entry: { ‘hero’: ‘./src/hero’, ‘call-to-action’: ‘./src/callToAction’, }, }; Ryan Welcher has an example repo and a video walk-through of its creation (that link is to … Read more

Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)

This is because you did not put singular.php in the URL, and if you did it wouldn’t make any sense. Remember, WordPress loads the template, not the other way round, your mental model of how this works is upside down. What’s going on? Why is singular.php the file being accessed while PHP prints that the … Read more

In creating a theme, how can i allow a user to change an image outside post/page content?

I ran into a similar problem recently. I found plug-in called “image widget” http://wordpress.org/extend/plugins/image-widget/screenshots/ that enabled upload right in the widget. The client though had no idea how to barely log in and find the widgets so I ended up using a flickr widget since it was more user friendly ( aka they could upload … Read more

User bar above logotipo?

If you’re looking for an example how this can be done, grab the current development version of wordpress. It’s already everything in there you might need / can imagine. If you don’t want to make use of 3.1 but 3.0, use the 3.1 code as the example you’re asking for. The user bar is located … Read more

What PNG Fix script do you recommend for IE6?

Drawbacks using javascript to fix the PNG issue: higher chances theat the IE-6 visitor doesn’t have javascript turned on, than on a modern browser ~1-2 sec. flicker until page finishes loading and javascript completes processing (on IE-6 js is slow) fixing repeating transparent background images is very buggy in these type of scripts, in most … Read more