Skip to content

Instantly share code, notes, and snippets.

@lizkaraffa
lizkaraffa / orginal-home.php
Created January 12, 2016 18:12
Original template file before my changes.
<?php $pageOne = get_theme_mod( 'page_one', '2' ); $pageTwo = get_theme_mod( 'page_two', '2' ); $pageThree = get_theme_mod( 'page_three', '2' ); ?>
<?php if ( 'false' == ( $pageOne ) || '' != ( $pageOne ) && 'false' == ( $pageTwo ) || '' != ( $pageTwo ) && 'false' == ( $pageThree ) || '' != ( $pageThree ) ) { ?>
<!-- BEGIN .row -->
<div class="row featured-pages">
<!-- BEGIN .content -->
<div class="content">
<!-- BEGIN .sixteen columns -->
function swell_theme_customizer( $wp_customize ) {
//-------------------------------------------------------------------------------------------------------------------//
// Page Templates
//-------------------------------------------------------------------------------------------------------------------//
$wp_customize->add_section( 'swell_templates_section' , array(
'title' => __( 'Page Templates', 'swelltheme' ),
'priority' => 103,
) );
<?
/**
* @author Joachim Kudish
* @uses SLD Custom Content Types & Taxonomies
* types & taxonomies
*/
if (function_exists('sld_register_post_type')) :
public function add_meta_box( $post_type ) {
$post_type = 'notes'; //limit meta box to certain post types
add_meta_box(
'handshaken_note_settings',
__( 'Note Settings', 'handshaken' ),
array( $this, 'render_meta_box_content_note' ),
$post_type,
'advanced',
'high'
);
<?php
/**
* @package Basis
*/
if ( ! function_exists( 'basis_customize_colors' ) ) :
/**
* Add color theme options via the WordPress Customizer.
*
* @since 1.0.
@lizkaraffa
lizkaraffa / overlay.js
Created July 21, 2014 19:51
Overlay functionality
/**
* overlay.js
*
* Handles toggling the whole screen overlay when nav button is clicked.
*/
(function(){
$("#slider-btn").toggle(function() {
$('#page-overlay').css('display','block');
$('.menu-main-menu-container').css('display','block');
@lizkaraffa
lizkaraffa / front-page.php
Created July 12, 2014 03:09
Front Page of Port LBC
<?php
/**
* Template: Front Page
*
* @package port
*/
get_header(); ?>
<div class="wrapper">
@lizkaraffa
lizkaraffa / gist:81d0949884c16c9d7b14
Created June 4, 2014 03:54
the template file for the staff grid to be pulled in by the parent sectional page template.
<?php
/**
* Template Name: Staff Page
*
* This is the template that creates a single section
* to be displayed in a Parent Sectional Page.
*
* @package garden
*/
@lizkaraffa
lizkaraffa / gist:f10fdc56af18d1866b7d
Created May 20, 2014 22:08
Parent Sectional Page
<?php
/*
* Template Name: Parent Sectional Page
* Description: The template for displaying sectional pages such as the About or Connect pages.
*
* This is the template that displays sectional pages. It will
* pull in the lower level sub-sections and display them all as one page.
*
* @package garden
*/
@lizkaraffa
lizkaraffa / data.php
Last active August 29, 2015 13:58
Forum Challenge: Reading and Displaying Data (Part 1); Language Used: PHP; Author: Liz Karaffa
<?php
// Gets essay
$text = file_get_contents('http://treehouse-forum-contests.s3.amazonaws.com/visualizing-information/part-one/essays-first-series.txt');
// Removes extra line space and carriage returns, makes essay lowercase and removes all punctuation & numbers
$returns = array(chr(10), chr(13), ",--");
$punctuation = array(".", ",", ":", ";", "--", "?", "!", "'", '"', "{", "}", "_", "*", 1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
$text = strtolower(str_replace($returns, " ", $text));
$text = str_replace($punctuation, "", $text);