Posts filed in "code_snippets"

Using rem in font-size

With most browsers users can zoom in if the text is too small to read, but from a developer perspective it could be wise to make the text more scalable by using ‘rem’ in stead of ‘px’.
‘rem’ is not supported on IE8 and below, but who cares nowadays …

So in the css-file it looks like this (in this case using pixels as a fallback):

WordPress Css-versioning

Versioning based on the file’s last modified time. When the style.css file is updated on the server, WordPress will append the appropriate timestamp, so there’s no need to refresh the cache with ctrl-r (or ctrl-f5). Note: don’t use time() as the 4th parameter or append it to the file, as this will break caching in almost all cases.

responsive styling for iframes and videos

Some css magic for creating responsive videos and iframes:

Enable the thumbnail meta box in the attachment edit screen

The following code enables the thumbnail meta box (featured image in backend) in Attachment edit screen.

bbpress: disable the possibility an admin can see others private-messages

select any user to be credited as author (Gutenberg Rest-Api)

© 2020 Jakob Helmer - Powered by WordPress - @trails&tribulations