Skip to content

Instantly share code, notes, and snippets.

View timothyjensen's full-sized avatar

Tim Jensen timothyjensen

View GitHub Profile
<?php
//* The Gravity form number where the user signs up for your Dreamhost Announce list
$gf_num = 2;
//* Transmit the data to Dreamhost after the form has been submitted
add_action('gform_after_submission_' . $gf_num , 'tj_send_to_dreamhost', 10, 2);
function tj_send_to_dreamhost($entry) {
$key = 'XXXXXXXXXXX'; //* unique key obtained from Dreamhost at https://panel.dreamhost.com/?tree=home.api
<?php
/* Push data from Donations page to Google sheets. One form submission can populate several rows in the Google Sheet */
// Make sure the trailing number (gform_after_submission_X) corresponds with the correct form number
add_action('gform_after_submission_1', 'add_to_google_spreadsheet_recurring', 10, 2);
function add_to_google_spreadsheet($entry, $form) {
// This is the web app URL of the Google Script running on the Google sheet
$post_url = "https://script.google.com/macros/s/XXXXXXXXX";
@timothyjensen
timothyjensen / header-url.php
Last active February 16, 2016 20:31 — forked from studiopress/header-url.php
Genesis header.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the header URL - XHTML Version
add_filter('genesis_seo_title', 'sp_seo_title', 10, 3);
function sp_seo_title($title, $inside, $wrap) {
$inside = sprintf( '<a href="http://www.yourdomain.com" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
return $title;
}
@timothyjensen
timothyjensen / template-grid-two-categories.php
Last active June 4, 2019 19:22
Genesis page template. Two rows of posts, with each row being a different category. Three posts per row and no pagination.
<?php
/**
* Template Name: Two Categories in Two Rows
*
*/
//* Remove the standard loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
//* Add classes to display the posts in a grid
@timothyjensen
timothyjensen / Gulpfile.js
Created May 25, 2016 19:53
Automate compiling Sass to CSS and browser refresh using BrowserSync
// Require our dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
gulp.task('styles', function(){
return gulp.src('sass/style.scss')
.pipe(sass({
outputStyle: 'expanded', // Options: nested, expanded, compact, compressed
indentType: 'tab',
@timothyjensen
timothyjensen / parallax.js
Created May 30, 2016 00:20 — forked from srikat/parallax.js
Applying Parallax effect from Parallax Pro in any Genesis theme. http://sridharkatakam.com/apply-parallax-effect-parallax-pro-genesis-theme/
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'parallax-section-below-header',
'name' => __( 'Parallax Section Below Header', 'your-theme-slug' ),
'description' => __( 'This is the parallax section below header.', 'your-theme-slug' ),
) );
genesis_register_sidebar( array(
'id' => 'parallax-section-above-footer',
'name' => __( 'Parallax Section Above Footer', 'your-theme-slug' ),
@timothyjensen
timothyjensen / genesis-remove-post-info-conditionally.php
Created May 30, 2016 12:37
Remove post info from posts in Genesis, except from a specified post type
<?php
//* Remove post info conditionally
add_action( 'genesis_before_entry' , 'tj_remove_post_info' );
/**
* Remove post info from posts except from the Devotional post type
*
* @return void
*/
@timothyjensen
timothyjensen / plugin-check-for-genesis.php
Created May 31, 2016 17:52
Checks if the Genesis Framework is active. If not, it deactivates the plugin.
<?php
/**
* This function is triggered when the WordPress theme is changed.
* It checks if the Genesis Framework is active. If not, it deactivates the plugin.
*
* @since 1.0
* @author Chimnoy Paul
*/
function gcfws_plugin_deactivate() {
if ( ! function_exists( 'genesis' ) ) {
@timothyjensen
timothyjensen / more-link.php
Last active October 15, 2016 21:01
Customize the default more link, and add that custom link to manual excerpts
@timothyjensen
timothyjensen / sibling-page-links.php
Last active September 2, 2016 20:48
Renders buttons that link to a page's closest siblings