Wrap image with relative padded parent. Keep image ratio with percentage on the padding property. Image is full size absolute child.
Category: 2019
Every jQuery Selector
The main purpose of these selectors is to select elements on a web page that meet certain criteria. The criteria can be anything like their id, classname, attributes or a combination of any or all of these. Most of the selectors in jQuery are based on existing CSS selectors but the library also has its […]
Caching Returned Elements
When you have to use the same selector many times, it is much better to cache the returned element(s) in a variable. This will avoid multiple scans and improve performance. As an example: can be written as: This way the browser only has to scan the document once rather than three times. Even though the […]
WordPress Publish Post Hook
One of the best parts of WordPress is its hook/action system; this special hook system is WordPress’ way of assigning callbacks when certain events occur. One event that there seems to be a lot of confusion over is which hook to use to detect when a post is initially published. There’s the publish_post hook but […]
Add Custom CSS to WordPress Admin
Step 1: Create Your CSS File You can place the CSS file wherever you’d like; I’ve chosen to place the CSS file within my theme. My admin CSS file looks like: The CSS above makes tags more visible. It also will make any PRE element without a class more apparent, teling me I need to […]
Add Submenu to WordPress Admin Bar
add to functions.php Setting an id on parent menu item allows parent key for submenu items https://davidwalsh.name/add-submenu-wordpress-admin-bar By David Walsh on January 6, 2015