Skip to content

Instantly share code, notes, and snippets.

View isaacdanielanderson's full-sized avatar

Isaac Anderson isaacdanielanderson

View GitHub Profile
@isaacdanielanderson
isaacdanielanderson / page.php
Last active October 10, 2018 20:20
Query in specific custom post type with a custom query
<?php
$servicesCpt = new WP_Query(array(
'posts_per_page' => -1,
'post_type' => 'teamMembers',
'orderby' => 'title',
'order' => 'DESC'
)
);
if ($servicesCpt->have_posts()) { ?>
<?php
@isaacdanielanderson
isaacdanielanderson / App.js
Created October 10, 2018 16:10
Equalize col heights using JS
// Equalize column heights on BS3 version using JS
// https://stackoverflow.com/questions/23287206/same-height-column-bootstrap-3-row-responsive
// EXAMPLE:
// Equalize heights on BS4 cards
$( document ).ready(function() {
var heights = $(".card").map(function() {
return $(this).height();
}).get(),
maxHeight = Math.max.apply(null, heights);
@isaacdanielanderson
isaacdanielanderson / margins.css
Created October 1, 2018 18:31
Margins framework classes
.mr-10 {
margin-right: 10px;
}
.mr-20 {
margin-right: 20px;
}
.mr-30 {
margin-right: 30px;
}
.mr-40 {
@isaacdanielanderson
isaacdanielanderson / mixins.css
Created September 12, 2018 05:34
postcss-mixins Bootstrap Breakpoint Media Queries
/* Boostrap 4.1.3 breakpoints for page widths */
/* Extra small devices (portrait phones, less than 576px)
* No media query since this is the default in Bootstrap
*
* postcss-mixins: https://www.npmjs.com/package/postcss-mixins
*/
/* Small devices (landscape phones, 576px and up) */
@define-mixin sm_up {
@media (min-width: 576px) {
@mixin-content;
@isaacdanielanderson
isaacdanielanderson / loop-custom.php
Created September 8, 2018 20:23 — forked from kevinwhoffman/loop-custom.php
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@isaacdanielanderson
isaacdanielanderson / gulpfile.js
Created August 30, 2018 00:11 — forked from leymannx/gulpfile.js
Gulp Sass with autoprefixer and minify.
var gulp = require('gulp'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssnano'),
prefix = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
sassLint = require('gulp-sass-lint'),
sourcemaps = require('gulp-sourcemaps');
// Temporary solution until gulp 4
@isaacdanielanderson
isaacdanielanderson / index.php
Created August 14, 2018 19:46
Great way to get custom excerpts if they exist; if not get the normal excerpt
<?php if (has_excerpt()) {
echo get_the_excerpt();
} else {
echo wp_trim_words(get_the_content(), 18);
}?>
@isaacdanielanderson
isaacdanielanderson / _contact-form.scss
Created June 28, 2018 22:33
Contact Form 7 Styling Example
+.wpcf7-form {
+ @include breakpoint(md) {
+ max-width: 600px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ p {
+ label {
+ width: 100%;
+ font-weight: bold;
@isaacdanielanderson
isaacdanielanderson / gist:70f3aae4c14b5777cfb01db779019cf2
Created April 17, 2018 22:57 — forked from lnpbk/gist:9249512
Change line-height in atom editor
/*
* Go to Settings > Themes > your stylesheet, and add the following
*/
@line-height: 2em;
.tree-view {
}
@isaacdanielanderson
isaacdanielanderson / _grid.scss
Created April 7, 2018 06:16
Super simple grid system
.container{
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
/*-- our cleafix hack -- */
.row:before,
.row:after {
content:"";