Skip to content

Instantly share code, notes, and snippets.

@dn7734
dn7734 / taxonomy-products.php
Created December 19, 2016 11:43
display products for a specific taxonomy term
<?php $term_title = single_term_title('', 0); ?>
<?php echo '<h2 class="block-title">' . $term_title . '</h2>'; ?>
<?php $description = term_description();
echo $description; ?>
<?php $term_slug = get_queried_object()->slug;
if ( !$term_slug )
return;
else
$args = array(
'tax_query' => array(
<?php /* acf taxonomy field */ ?>
<?php $terms = get_field('product_category'); ?>
<?php if( $terms ): ?>
<?php foreach( $terms as $term ): ?>
<a href="<?php echo get_term_link( $term ); ?>">'<?php echo $term->name; ?>'</a>
<?php endforeach; ?>
<?php endif; ?>
@dn7734
dn7734 / flexible-type.css
Created May 2, 2016 21:11 — forked from AllThingsSmitty/flexible-type.css
Use :root for flexible type
/* This has been added to CSS Protips https://github.com/AllThingsSmitty/css-protip */
/* The type font size in a responsive layout should be able to adjust with each viewport.
You can calculate the font size based on the viewport height and width using :root */
:root {
font-size: calc(1vw + 1vh + .5vmin);
}
/* Now you can utilize the root em unit based on the value calculated by :root */
body {
@dn7734
dn7734 / packery.sublime-settings
Created November 6, 2015 11:27
sublime wordpress sage packery.sublime-settings
<snippet>
<content><![CDATA[
<section class="packery">
<div class="container">
<div class="row text-center">
<h2 class="heading-title">
<?php echo get_field('packery_title'); ?>
<span class="line-title"></span>
</h2>
@dn7734
dn7734 / contact_us.php
Created November 6, 2015 11:00
wordpress sage contact_us.php
<?php
/**
* Template Name: Contact-us
*/
?>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<?php
$location = get_field('contact_map');
@dn7734
dn7734 / setup.php
Created November 6, 2015 10:40
wordpress sage lib setup.php
<?php
namespace Roots\Sage\Setup;
use Roots\Sage\Assets;
/**
* Theme setup
*/
function setup() {
@dn7734
dn7734 / _global.scss
Last active November 6, 2015 10:41
wordpress sage assets/styles/common _global.scss
/* hero_content */
.content-1 {
padding-bottom: 147px;
background-repeat: no-repeat;
text-align: center;
background-size: cover;
.Happy-Clients {
font-size: 24px;
font-family: "Montserrat";
color: rgb(238, 238, 238);
@dn7734
dn7734 / main.js
Last active November 6, 2015 10:41
wordpress sage assets/scripts main.js
/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
*
* Only fires on body classes that match. If a body class contains a dash,
* replace the dash with an underscore when adding it to the object below.
*
* .noConflict()
* The routing is enclosed within an anonymous function so that you can
* always reference jQuery with $, even when in .noConflict() mode.
@dn7734
dn7734 / function.php
Created November 2, 2015 16:03
wordpress sage function.php
<?php
/**
* Sage includes
*
* The $sage_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
* @link https://github.com/roots/sage/pull/1042
@dn7734
dn7734 / front-page.php
Last active November 6, 2015 10:21
wordpress sage front-page.php
<?php /* remove_filter ('the_content', 'wpautop'); */ ?>
<section class="slider">
<div class="owl-carousel">
<!-- owl-carousel include to assets/scripts/main.js
// JavaScript to be fired on all pages
$(".owl-carousel").owlCarousel({
items:1
});
-->