Skip to content

Instantly share code, notes, and snippets.

View emaildano's full-sized avatar
🏄‍♀️
Surfing the information superhighway

Dano emaildano

🏄‍♀️
Surfing the information superhighway
  • Philadelphia, PA
View GitHub Profile
//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
// Extra small screen / phone
// Note: Deprecated @screen-xs and @screen-phone as of v3.0.1
@screen-xs: 0; //480px;
@screen-xs-min: @screen-xs;
@screen-phone: @screen-xs-min;
@emaildano
emaildano / group-by-tax.php
Created March 9, 2014 15:48
Group posts by taxonomy.
<?php
$get_current_cat = get_term_by('name', single_cat_title('',false), 'category');
$current_cat = $get_current_cat->term_id;
// List posts by the terms for a custom taxonomy of any post type
$post_type = 'special_events';
$tax = 'locations';
$tax_terms = get_terms( $tax, 'orderby=name&order=ASC');
if ($tax_terms) {
@emaildano
emaildano / wp-favicon.php
Created February 14, 2014 21:28
Wordpress function for custom favicon.
// Add Favicon
function favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_template_directory_uri().'/assets/favicon/favicon.ico" />';
}
add_action('wp_head', 'favicon');
@emaildano
emaildano / acf-radio-button-example.php
Last active October 14, 2016 08:08
ACF Radio Button Example
<?php $program = get_sub_field('program_selection'); ?>
<?php if( $program == 'intensity' ){ ?>
<?php } else if( $program == 'crossfit' ){ ?>
<?php } else if( $program == 'personal' ){ ?>
<?php } else if( $program == 'allprograms' ){ ?>
@emaildano
emaildano / bootstrap-wp-query-reset.php
Created February 13, 2014 21:57
Bootstrap row reset query example.
<?php
/*
Template Name: Trainers Template
*/
?>
<div class="trainers-grid">
<?php
$args = array(
@emaildano
emaildano / asymmetrical-query.php
Created February 13, 2014 21:37
Asymmetrical post query.
$args = array( 'post_type' => 'video', 'posts_per_page' => 10,);
$the_query = new WP_Query( $args );
echo '<section id="our-work">';
if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();
$counter += 1;
if ($counter == 1 || $counter == 4 || $counter == 6 || $counter == 9) {
@emaildano
emaildano / cpt-query.php
Created February 13, 2014 19:52
Query custom post type and reset query.
<?php
$args = array( 'post_type' => 'trainers', 'posts_per_page' => -1 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
@emaildano
emaildano / found-posts.php
Created February 4, 2014 18:56
Displays number of found posts in Wordpress.
<?php global $wp_query; echo '<p>Found ' . $wp_query->found_posts . ' hits.</p>'; ?>
@emaildano
emaildano / font-awesome-accordion-toggle.js
Created February 4, 2014 02:00
Snippet for using Font-Awesome Plus and Minus icons on Bootstrap Accordions
jQuery('.accordion section').click(function() {
jQuery(this).toggleClass('active').find('i').toggleClass('fa-plus fa-minus')
.closest('section').siblings('section')
.removeClass('active').find('i')
.removeClass('fa-minus').addClass('fa-plus');
});