Skip to content

Instantly share code, notes, and snippets.

View zoerooney's full-sized avatar

Zoe Rooney zoerooney

View GitHub Profile
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WordPress
@zoerooney
zoerooney / index.html
Last active August 29, 2015 14:01
GDI Class Samples
<!DOCTYPE HTML>
<html>
<head>
<title>OCCASIONETTE</title>
<link rel="stylesheet" type="text/css" href="reset.css">
<link rel="stylesheet" type="text/css" href="style.css">
<link href='https://fonts.googleapis.com/css?family=Pompiere|Sacramento' rel='stylesheet' type='text/css'>
</head>
<body>
@zoerooney
zoerooney / full-snippet.php
Last active August 29, 2015 14:01
Display posts by views using Jetpack plugin data, tutorial here: http://zoerooney.com/blog/tutorials/top-posts-by-page-views/ (publish date: 5/16)
<?php if( function_exists( 'stats_get_csv' ) ) :
$top_posts = stats_get_csv( 'postviews', array( 'days' => 21, 'limit' => -1 ) );
$top_ids = array();
foreach ( $top_posts as $top_post ) {
$top_ids[] = $top_post['post_id'];
}
// Check for transient, hat tip Greg Rickaby
if ( false === ( $tops = get_transient( 'popular_posts' ) ) ) :
data-platform="<?php echo implode(', ', get_field('platform')); ?>"
data-project-type="<?php echo implode(', ', get_field('project_type')); ?>"
data-designer="<?php the_field('designers'); ?>"
body {
font-size: 14px;
padding: 50px
}
/*
div {
background: lemonchiffon;
margin: 0 auto;
width: 400px;
padding:20px
@zoerooney
zoerooney / Gruntfile.js
Created March 12, 2014 16:25
Grunt files for posterity (we've switched to Gulp)
'use strict';
module.exports = function(grunt) {
// load all grunt tasks that start with 'grunt-'
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php if ( bbp_is_single_forum() ) :
bbp_forum_content();
endif; ?>
</header><!-- .entry-header -->
@zoerooney
zoerooney / gulpfile.js
Last active August 29, 2015 13:56
current Gulp configuration
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
livereload = require('gulp-livereload');
gulp.task('styles', function(){
return sass('scss/')
.on('error', function (err) {
console.error('Error!', err.message);
@zoerooney
zoerooney / wordpress-twitter-cards.php
Last active January 26, 2017 10:35
WordPress Twitter card info (assumes you've already got basic open graph data via a plugin), tutorial here: http://zoerooney.com/blog/tutorials/increase-share-ability-using-twitter-cards/
<?php // Include Twitter IDs for content creator (you, usually) ?>
<meta name="twitter:site" content="@zoe_rooney"/>
<meta name="twitter:creator" content="@zoe_rooney"/>
<?php
// get current post ID
$currentpost = get_the_ID();
// get radio value
$radio = get_field( 'twitter_card_options', $currentpost );