Skip to content

Instantly share code, notes, and snippets.

View alisonmf's full-sized avatar
🏠
Working from home

Alison Fulton alisonmf

🏠
Working from home
View GitHub Profile
@alisonmf
alisonmf / gobble-tier.php
Last active October 28, 2022 18:32
WordPress - Get child pages and grandchild page list. Get ancestor list when on grandchild page.
<?php
if(is_page())
{
//Assuming current working page is the parent
//
$the_parent_id = $post->ID;
//Otherwise get the greatest ancestor id
//
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div>
<div style="color: rgb(34, 34, 34); line-height: normal; widows: 1;">
@alisonmf
alisonmf / sans-pricelabel.php
Created August 6, 2014 22:50
Remove price label from gravity form product field
<?php if ( is_page('slug') ) { // only executes on this page ?>
<script type="text/javascript">
function gform_format_option_label(fullLabel, fieldLabel, priceLabel, selectedPrice, price, formId, fieldId)
{
// Only for field with ID of 5
if (fieldId == 5)
// Disable option pricing. Simply return the field label.
// This removes the price differentials in the drop down
return fieldLabel;
}
@alisonmf
alisonmf / functions.php
Created October 21, 2015 20:31
add fonts in editor styles
//pulls in the fonts from fonts.com
function gob_add_editor_styles() {
$font_url = str_replace( ',', '%2C', '//url.com/style.css' );
add_editor_style( $font_url );
}
add_action( 'after_setup_theme', 'gob_add_editor_styles' );
@alisonmf
alisonmf / random.php
Last active September 26, 2015 14:28
quick pick florida lotto
<html>
<head>
<title>Random Numbers!</title>
</head>
<body>
<?php
//Random Numbers Script
@alisonmf
alisonmf / people.php
Created February 4, 2011 02:53
our people page
<?php
// Page Template Name: Culture / People
?>
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
@alisonmf
alisonmf / work.php
Created February 4, 2011 02:37
work template for the main work page
<?php
// Page Template Name: Work
?>
<?php get_header(); ?>
<div id="content">
@alisonmf
alisonmf / single-work.php
Created February 4, 2011 02:31
new single page for a single portfolio piece of work
<?php get_header(); ?>
<div id="content">
<h1 class="noLine">Work</h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="singleWork">
@alisonmf
alisonmf / post_thumbnail.php
Created January 26, 2015 21:13
the_post_thumbnail or Featured Image in WordPress
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
echo '<img src="';
@alisonmf
alisonmf / 0_reuse_code.js
Last active August 29, 2015 14:14
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