Skip to content

Instantly share code, notes, and snippets.

View hellolewis's full-sized avatar
:octocat:

Lewis Holloway hellolewis

:octocat:
  • West Midlands
View GitHub Profile
@hellolewis
hellolewis / responsive-acf.php
Created November 10, 2020 20:47 — forked from brianmaierjr/responsive-acf.php
Responsive Images with ACF
<?php
$image = get_field('banner_bg_image');
$medium = $image['sizes'][ 'medium' ];
$large = $image['sizes'][ 'large' ];
$full = $image[ 'url' ];
?>
<style>
@media screen and (min-width: 1024px) {
.banner--interior {
background-image: url(<?php echo $full; ?>);
<?php
function role_admin_body_class( $classes ) {
global $current_user;
foreach( $current_user->roles as $role )
$classes .= ' role-' . $role;
return trim( $classes );
}
add_filter( 'admin_body_class', 'role_admin_body_class' );
function wp_admin_field_css() {
@hellolewis
hellolewis / .htaccess
Created August 29, 2019 12:37 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/