Zum Inhalt springen Skip to navigation

Webrocker Blog

Archiv für "Filter"

WordPress filter for lazy loading src

Chris Coyier (@css) has shared a code snippet that will add loading="lazy" to every scr=" instance in WordPress's content. But this will replace every instance, not only in img or iframe tags, which can lead to some unwanted replacements. Here's my version for that filter: // in theme’s functions.php or a plugin function wbr_add_lazy_loading($content){ $content…


Add class attribute to WordPress "the_tags" markup

Link to post Add class attribute to WordPress "the_tags" markup

I'm in the process of gradually enhancing my site's markup with microformats, in order to "indiewebify" my site further. On thing I noticed while working on this at the Düsseldorf Indiewebcamp, is that WordPress (or the way my theme handles) tags on posts has no way to get an additional class inside the link markup.…