Skip to content

Instantly share code, notes, and snippets.

View joecue's full-sized avatar
🎯
Focusing

Joe Querin joecue

🎯
Focusing
View GitHub Profile
@joecue
joecue / json.html
Last active June 10, 2016 15:11
JSON Example for Retrieving Media Post Data from WP-API
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
@joecue
joecue / color-fade.html
Created February 15, 2016 16:07
CSS Color Fading Example
<!DOCTYPE html>
<html>
<head>
<title> Color fade example</title>
<link href='https://fonts.googleapis.com/css?family=Raleway:400,800|Rock+Salt' rel='stylesheet' type='text/css'>
<style>
body{
padding: 0;
margin: 0;
@joecue
joecue / calendar.php
Last active November 24, 2023 23:59
PHP Script to Generate a Calendar Grid for the month of the Current date.
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<style>
body{font-family: Lato;}
caption{font-size: 22pt; margin: 10px 0 20px 0; font-weight: 700;}
table.calendar{width:100%; border:1px solid #000;}
td.day{width: 14%; height: 140px; border: 1px solid #000; vertical-align: top;}
td.day span.day-date{font-size: 14pt; font-weight: 700;}
th.header{background-color: #003972; color: #fff; font-size: 14pt; padding: 5px;}
@joecue
joecue / plugin.php
Created March 16, 2016 12:54
WordPress - Theme file in Plugin
function my_event_template($single_template) {
global $post;
if ($post->post_type == 'event') {
return dirname( __FILE__ ) . '/single-event.php';
return $single_template;
}
add_filter( "single_template", "my_event_template" ) ;
@joecue
joecue / gulpfile.js
Last active April 29, 2016 00:02
LCCC WD2 - Sample Gulp file, and package json file
var project = 'twentyfifteen_child',
parentTheme = 'twentyfifteen',
gulp = require('gulp'),
sass = require('gulp-sass'),
notify = require('gulp-notify'),
header = require('gulp-header'),
plumber = require('gulp-plumber');
gulp.task('sass', function () {
return gulp.src('./themes/' + project + '/scss/style.scss')
@joecue
joecue / email-metabox.php
Created May 13, 2016 18:22
Custom WordPress Meta Box to Capture Date to select posts from.
<?php
/*
* Code adapted from https://www.smashingmagazine.com/2011/10/create-custom-post-meta-boxes-wordpress
* Created May 2016.
*
*/
/* Fire our meta box setup function on the post editor screen. */
add_action( 'load-post.php', 'lc_emailer_post_meta_boxes_setup' );
@joecue
joecue / guest.html
Created June 10, 2016 15:51
JavaScript from MyCampus - Display Posts from WordPress Via WP REST API
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) {
$.getJSON("http://sites.lorainccc.edu/mylccc/wp-json/wp/v2/posts/?filter[category_name]=mycampus", function (data) {
$.each(data, function( index ){
@joecue
joecue / gulp-modules.txt
Last active August 22, 2019 15:54
Copy a line below and then click on bash terminal window and press insert key.
npm install gulp --save-dev
npm install browser-sync --save-dev
npm install gulp-autoprefixer --save-dev
npm install gulp-changed --save-dev
npm install gulp-combine-media-queries --save-dev
npm install gulp-concat --save-dev
npm install gulp-debug --save-dev
npm install gulp-filter --save-dev
npm install gulp-header --save-dev
npm install gulp-newer --save-dev
@joecue
joecue / functions.php
Created July 24, 2016 01:32
Reset WordPress User Role Capabilities
if ( !function_exists( 'populate_roles' ) ) {
require_once( ABSPATH . 'wp-admin/includes/schema.php' );
}
populate_roles();
@joecue
joecue / slider.css
Created March 1, 2017 00:29
Web Design 1 Javascript Slider Code
#slider {
margin: 2em auto;
width: 960px;
overflow: hidden;
}
#slider-wrapper {
width: 9999px;
height: 300px;
position: relative;