Skip to content

Instantly share code, notes, and snippets.

@moxdev
moxdev / absolute-centering.css
Created June 21, 2019 13:50
Center absolute position for IE11 #css
// Position center 50% left 0 (works in IE11)
position: absolute;
top:50%;
left:0;
transform:translate(0, -50%);
// Position center 50% left 50% (works in IE11)
position: absolute;
@moxdev
moxdev / bs-config.js
Created May 14, 2019 18:36
Browser Sync Config File
/*
|--------------------------------------------------------------------------
| Browser-sync config file
|--------------------------------------------------------------------------
|
| For up-to-date information about the options:
| http://www.browsersync.io/docs/options/
|
| There are more options than you see here, these are just the ones that are
@moxdev
moxdev / wp-custom-srcset.php
Created March 6, 2019 15:24
Srcset Custom Wordpress #wp
<img src="<?php echo esc_url( $sm_img ); ?>" alt="<?php echo esc_attr( $alt ); ?>"
srcset="
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-sm' ) ); ?> 250w,
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-md' ) ); ?> 550w,
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-lg' ) ); ?> 850w,
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-xlg' ) ); ?> 1150w">
@moxdev
moxdev / photo-gallery-with-lightbox-styles.scss
Last active March 6, 2019 15:18
Photo Gallery with Lightbox ACF #acf #wp #jsLibrary
@moxdev
moxdev / page-header-seo.php
Created March 6, 2019 15:01
Page header SEO ACF #wp #acf
<?php
// Page Titles.
if ( ! function_exists( 'slug_page_titles' ) ) :
/**
* Output custom page titles for SEO
*
* @return void
*/
function slug_page_titles() {
@moxdev
moxdev / customizer.php
Created February 14, 2019 17:01
Disable Uneccessary Deafult Panels In Underscores Theme #wp
// Disable uneccessary panels in theme customizer.
$wp_customize->get_section( 'header_image' )->active_callback = '__return_false';
$wp_customize->get_section( 'colors' )->active_callback = '__return_false';
$wp_customize->get_section( 'custom_css' )->active_callback = '__return_false';
@moxdev
moxdev / arrow.scss
Last active February 14, 2019 15:35
Adds Mobile Menu Dropdown Button #wp
.arrow {
position: absolute;
right: 10px;
top: 13px;
bottom: 5px;
padding: 0;
width: 32px;
height: 32px;
background: none;
color: #FFF;
@moxdev
moxdev / yoast-move-bottom.php
Created February 14, 2019 15:01
Move Yoast to the Bottom of the Page #wp
add_filter( 'wpseo_metabox_prio', 'yoast_to_bottom' );
/**
* Move Yoast to bottom of page in WP backend
*/
function yoast_to_bottom() {
return 'low';
}
@moxdev
moxdev / read-more-links.php
Created February 14, 2019 15:00
Custom Read More Links #wp
@moxdev
moxdev / img.css
Last active February 14, 2019 14:51
Function - Object Fit Polyfill for IE #wp #js #jsLibrary
img {
display: block;
object-fit: cover;
font-family: 'object-fit: cover';
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;