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 / 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 / sibling-page-links.php
Last active September 2, 2016 20:48
Renders buttons that link to a page's closest siblings
@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 / config.php
Created March 1, 2017 02:01
Example config for get_all_custom_field_meta()
<?php
$config = array(
array(
'name' => 'prefix_subtitle',
),
array(
'name' => 'prefix_content_row',
'sub_fields' => array(
array(
'name' => 'css_classes',
@timothyjensen
timothyjensen / output.php
Created March 1, 2017 02:22
Example output of get_all_custom_field_meta()
<?php
array(
'prefix_subtitle' => 'This is the subtitle',
'prefix_content_row' => array(
array(
'css_classes' => 'extra-class row-1',
'background_color' => '1',
'columns' => array(
array(
'column' => 'Row 1 column 1',