Skip to content

Instantly share code, notes, and snippets.

View seothemes's full-sized avatar

SEO Themes seothemes

View GitHub Profile
<?php
// Create array of variables default colors
$seo_default_colors = array(
'color-text' => '#333333',
'color-button' => '#333333',
'color-link' => '#dddddd',
'color-white' => '#ffffff',
'color-outline' => '#eeeeee',
<?php
// Register settings and controls with the Customizer.
add_action( 'customize_register', 'seo_customizer_register' );
function seo_customizer_register() {
global $wp_customize;
global $seo_default_colors;
// Loop through each variable in the array
foreach($seo_default_colors as $key => $value) {
<?php
// Check if WP-SCSS plugin is active
if ( !is_plugin_active( 'wp-scss/wp-scss.php' ) ) {
return;
}
// Always recompile in the customizer
if ( is_customize_preview() && !defined('WP_SCSS_ALWAYS_RECOMPILE')) {
define('WP_SCSS_ALWAYS_RECOMPILE', true);
}
<?php
/**
* Requires the WP-SCSS plugin to be installed and activated.
*
* @package Customizer Sass
* @link https://seothemes.net
* @author Seo Themes
* @copyright Copyright © 2017 Seo Themes
* @license GPL-2.0+
*/
<?php
/**
* This file adds the starter content to the Genesis Starter theme.
*
* @package Genesis Starter
* @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
* @author Seo Themes
* @copyright Copyright © 2017 Seo Themes
* @license GPL-2.0+
*/
<?php
/**
* This file adds customizer settings to the Genesis Starter theme.
*
* Requires WP SCSS
*
* @package Genesis Starter
* @link https://seothemes.net/genesis-starter
* @author Seo Themes
* @copyright Copyright © 2017 Seo Themes
@seothemes
seothemes / customizer-widget-titles.php
Last active February 24, 2017 12:35
An example of how to add widget titles using the Customizer.
// Register demo widget area.
genesis_register_sidebar( array(
'id' => 'demo_widget',
'name' => __( 'Demo Widget', 'mytheme' ),
'description' => __( 'This is the demo widget area.', 'mytheme' ),
) );
// Hook demo widget area before site footer.
function mytheme_demo_widget_area() {
<div class="five-sixths">five sixths</div><div class="one-sixth">one sixth</div>
<div class="three-fourths">three fourths</div><div class="one-fourth">one fourth</div>
<div class="two-thirds">two thirds</div><div class="one-third">one third</div>
<div class="two-thirds">two thirds</div><div class="one-sixth">one sixth</div><div class="one-sixth">one sixth</div>
<div class="one-half">one half</div><div class="one-half">one half</div>
<div class="one-half">one half</div><div class="one-fourth">one fourth</div><div class="one-fourth">one fourth</div>
<div class="one-third">one third</div><div class="two-thirds">two thirds</div>
<div class="one-third">one third</div><div class="one-third">one third</div><div class="one-third">one third</div>
<div class="one-third">one third</div><div class="one-third">one third</div><div class="one-sixth">one sixth</div><div class="one-sixth">one sixth</div>
<div class="one-third">one third</div><div class="one-sixth">one sixth</div><div class="one-third">one third</div><div clas
@seothemes
seothemes / genesis-flexible-widgets.php
Created March 28, 2017 06:22
Add flexible column classes to widget areas.
<?php
/**
* Add flexible widget classes.
*
* @param string $id Widget area ID.
* @return string $class Flexible widgets CSS class.
*/
function starter_widgets_flex_class( $id ) {
global $sidebars_widgets;
<?php
/**
* Only load JMIG on specific pages.
*/
function jmig_pages() {
if ( ! is_page( array( 148, 150 ) ) ) {
remove_action( 'wp_enqueue_scripts', 'jmig_css', 99 );
remove_action( 'wp_enqueue_scripts', 'jmig_js' );