Skip to content

Instantly share code, notes, and snippets.

View seothemes's full-sized avatar

SEO Themes seothemes

View GitHub Profile
@seothemes
seothemes / legal-pro-hero-fix.php
Last active February 3, 2018 06:17
Fixes old legal pro hero issue.
@seothemes
seothemes / ontouchstart.php
Created May 15, 2018 03:15
Adds ontouchstart attribute to body in Genesis.
<?php
// Do not include opening PHP tag.
add_filter( 'genesis_attr_body', 'custom_add_ontouchstart_to_body' );
/**
* Add ontouchstart attribute to body.
*
* @param array $atts Body attributes.
* @return array
*/
@seothemes
seothemes / studio-pro-2.0.0-pricing-table.html
Created June 15, 2018 05:03
Studio Pro 2.0.0 Pricing Table
<h3>Two Columns</h3>
<div class="pricing-table">
<div class="one-half first"><strong>Price</strong><br>
<small>$</small>
<big>99.00</big>
<p></p>
<ul>
<li>First feature</li>
<li>Second feature</li>
<li>Third feature</li>
@seothemes
seothemes / functions.php
Created June 17, 2018 04:08
Widget area shortcode
<?php
// Do NOT include the opening php tag shown above. Copy the code shown below.
add_shortcode( 'widget_area', 'prefix_widget_area_shortcode' );
/**
* Display widget area with shortcode.
*
* @since 1.0.0
*
* @return string
@seothemes
seothemes / output-registered-sidebars.php
Created June 19, 2018 13:41
Outputs a list of widget area IDs.
<?php
// Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'wp_footer', 'prefix_list_widget_areas' );
/**
* Outputs a list of widget area IDs.
*
* @since 1.0.0
*
* @return void
@seothemes
seothemes / ACF - Nutrition Field
Last active June 29, 2018 07:33
Nutrition Facts label with ACF
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_5b31f1ec3a72f',
'title' => 'Nutrition',
'fields' => array (
array (
'key' => 'field_5b31fe209bc56',
'label' => 'Servings',
'name' => 'servings',
@seothemes
seothemes / child-theme-config-removable-widgets.php
Last active April 16, 2019 15:04
List of widgets that can be removed with the Child Theme Library config.
<?php
/*
|--------------------------------------------------------------------------
| Remove Widgets
|--------------------------------------------------------------------------
|
| Provides an easy way to remove unused widgets from the dashboard. This
| config is not used in premium Genesis child themes but is left here
| as an example for developers who might find this function useful.
@seothemes
seothemes / customizer-additional-js.php
Last active July 20, 2018 03:19
Adds an Additional JS control to the Customizer and outputs the JS in the site footer.
<?php
/**
* Additional JS Customizer Control
*
* @author Lee Anthony
* @link https://seothemes.com
* @copyright Copyright © 2018 SEO Themes
* @license GPL-2.0-or-later
*/
@seothemes
seothemes / archive-portfolio.php
Last active April 16, 2019 15:04
Adds a custom image before the page title in Business Pro.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'business_page_header', 'prefix_page_header_logo', 5 );
/**
* Display logo inside page header on portfolio archive.
*
* @since 1.0.0
*
* @return void
@seothemes
seothemes / widgets.php
Created August 8, 2018 05:09
List of Genesis, WordPress and WooCommerce widget classes.
<?php
\Genesis_Featured_Page::class,
\Genesis_Featured_Post::class,
\Genesis_User_Profile_Widget::class,
\WP_Widget_Pages::class,
\WP_Widget_Calendar::class,
\WP_Widget_Archives::class,
\WP_Widget_Links::class,
\WP_Widget_Media_Audio::class,