Skip to content

Instantly share code, notes, and snippets.

View seothemes's full-sized avatar

SEO Themes seothemes

View GitHub Profile
@seothemes
seothemes / functions.php
Created May 23, 2019 04:35
Set default fallback image on archives in Genesis
<?php
add_filter( 'genesis_get_image_default_args', 'prefix_set_image_fallback' );
/**
* Set default fallback image on archives.
*
* @since 1.0.0
*
* @param array $args Default image args.
*
@seothemes
seothemes / functions.php
Last active May 25, 2019 04:32
Dynamic CSS in WordPress
<?php
/**
* Load dynamic CSS stylesheet in WordPress. There are 4 steps:
*
* 1. Enqueue dynamic stylesheet on front end or add inline CSS if in Customizer.
* 2. Get the dynamic CSS with AJAX calls.
* 3. Generate CSS using PHP variables.
* 4. Minify CSS after before loading.
*/
@seothemes
seothemes / style.scss
Created May 22, 2019 01:51
Gravity Forms SCSS
/* ## Gravity Forms
--------------------------------------------- */
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
}
.gform_heading {
@seothemes
seothemes / functions.php
Created April 26, 2019 00:38
Add hook after title area
<?php
add_filter( 'genesis_markup_title-area_close', 'prefix_after_title_area', 10, 2 );
/**
* Appends HTML to the closing markup for .title-area.
*
* Adding something between the title + description and widget area used to require
* re-building genesis_do_header(). However, since the title-area closing markup
* now goes through genesis_markup(), it means we now have some extra filters
* to play with. This function makes use of this and adds in an extra hook
@seothemes
seothemes / functions.php
Created April 2, 2019 23:55
Simple Pricing Table - open links in new window
<?php
// Do NOT include the opening php tag.
add_filter( 'spt_markup_link_open', 'prefix_spt_button_markup' );
/**
* Open Simple Pricing Table links in new tab.
*
* @since 1.0.0
*
* @return string
@seothemes
seothemes / functions.php
Created March 31, 2019 23:47
Set breakpoint for custom header video
<?php
add_filter( 'header_video_settings', 'business_header_video_min_width', 10, 1 );
/**
* Change minimum width to show the header video.
*
* @since 1.1.0
*
* @link https://make.wordpress.org/core/2016/11/26/video-headers-in-4-7/
*
@seothemes
seothemes / bootstrap.php
Last active March 24, 2019 23:55
WP PhpUnit test config and bootstrap
<?php
/**
* Bootstraps the WordPress Integration Tests
*
* File should be placed in tests/phpunit/integration.
*
* @since 1.5.0
* @license GNU-2.0+
*/
@seothemes
seothemes / helpers.php
Created March 16, 2019 23:14
Studio Pro custom header fix
<?php
/**
* Studio Pro Theme
*
* This file adds helper functions used in the child theme.
*
* @package SeoThemes\StudioPro
* @link https://seothemes.com/themes/studio-pro
* @author SEO Themes
* @copyright Copyright © 2019 SEO Themes
@seothemes
seothemes / helpers.php
Created March 16, 2019 23:13
Business Pro custom header fix
<?php
/**
* Business Pro Theme
*
* This file adds helper functions to the Business Pro theme.
*
* @package BusinessProTheme
* @link https://seothemes.com/themes/business-pro
* @author SEO Themes
* @copyright Copyright © 2019 SEO Themes
@seothemes
seothemes / Gulpfile.js
Created March 6, 2019 22:58
Corporate Pro Gulpfile and package.json (Removed in 1.1.1)
/**
* Gulp task config file.
*/
'use strict';
var pkg = require( './package.json' ),
gulp = require( 'gulp' ),
globs = require( 'gulp-src-ordered-globs' ),
toolkit = require( 'gulp-wp-toolkit' ),