Skip to content

Instantly share code, notes, and snippets.

<?php if( have_rows('tabs') ): ?>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?>
<?php
$string = sanitize_title( get_sub_field('tab_title') );
?>
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> >
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a>
</li>
<?php $i++; endwhile; ?>
@Drixled
Drixled / Bootstrap4Nav-Sage9.md
Created August 21, 2018 04:50 — forked from smutek/Bootstrap4Nav-Sage9.md
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>stringify</title>
<meta name="description" content="">
var $grid = $('.grid').isotope({
itemSelector: '.grid-item',
masonry: {
horizontalOrder: true,
}
});
$grid.imagesLoaded().progress(function() {
$grid.isotope('layout');
});
@Drixled
Drixled / setCenter-markup.php
Last active October 25, 2017 16:42
ACF Google Maps - SetCenter.js
<!--
1. Seguir la siguiente documentacion: https://www.advancedcustomfields.com/resources/google-map/
2. El siguiente markup generara una lista de botones con el nombre de cada ubicación subida via
custom fields, cada boton obtiene la clase de 'setCenter' y hereda como atributos HTML5 la
latitud y longitud de la ubicacion seleccionada.
-->
.h1 { font-size: 2rem }
.h2 { font-size: 1.5rem }
.h3 { font-size: 1.25rem }
.h4 { font-size: 1rem }
.h5 { font-size: .875rem }
.h6 { font-size: .75rem }
.sans-serif { font-family: "museo-sans", sans-serif; }
.font-desyrel { font-family: 'Desyrel';}
.font-family-inherit { font-family: inherit }
<?php
$args = array (
'post_type' => 'post-type',
'posts_per_page' => -1
);
$query = new WP_Query( $args );
?>
<?php while( $query->have_posts() ): $query->the_post(); ?>
[content]
@Drixled
Drixled / type.css
Created May 1, 2016 02:12
Good vertical rythym typography
body {
font-family: Helvetica, Arial, sans-serif;
font-weight: 400;
font-style: normal;
font-size: 1.125rem;
line-height: 1.6875rem;
max-width: 760px;
padding: 1.6875rem;
margin: 0 auto;
}
<?php
// the query
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- pagination here -->
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
@Drixled
Drixled / 0_reuse_code.js
Created February 23, 2016 04:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console