Skip to content

Instantly share code, notes, and snippets.

wp.customize( 'primary_menu_location', function( value ) {
value.bind( function( to ) {
if ( to == 'before-header' ) {
$( '.nav-primary' ).detach().prependTo( '.site-container', to );
}
if ( to == 'before-footer' ) {
$( '.nav-primary' ).detach().prependTo( '.site-footer', to );
}
(function( $ ) {
"use strict";
wp.customize( 'genesis_background_color', function( value ) {
value.bind( function( to ) {
$( 'body' ).css( 'background-color', to );
} );
});
/**
* Registers options with the WordPress Theme Customizer
*
*/
function register_customizer_actions( $wp_customize ) {
$wp_customize->add_section(
'menu_location',
array(
'title' => 'Primary Menu Location',
if ( get_theme_mod( 'primary_menu_location' ) == 'before-header' ) {
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav', 10 );
}
body { background: #222222; color: #888888; }
a { color: #e5554e; }
a:hover { color: #eeeeee; }
.site-container { background: #242424; border: 1px solid #282828; }
.site-title a, .site-title a:hover { color: #eeeeee; }
h1, h2, h3, h4, h5, h6 { color: #dddddd; }
.entry-title, .entry-title a, .sidebar .widget-title { color: #eeeeee; }
.entry-title a:hover { color: #e5554e; }
<?php
/**
*
*/
class My_Genesis_Customizer extends Genesis_Customizer_Base {
/**
* Settings field.
*/
public $settings_field = 'genesis-settings';
//* Customize the entry meta in the entry header
add_filter( 'genesis_post_info', 'themecore_post_info_filter' );
function themecore_post_info_filter($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
function my_customizer_css() {
?>
<style type="text/css">
<?php $color = get_theme_mod( 'header_background_color' ); if ( $color ) { printf( '.site-header { background-color: %s; }', $color ); } ?>
</style>
<?php
}
add_action( 'wp_head', 'my_customizer_css' );
<script>
jQuery(document).ready(function() {
jQuery(".content-sidebar-wrap").remove();
});
</script>
<?php
/**
* Add custom body class for Genesis Customizer
*
*/
function gc_body_class( $classes ) {
$classes[] = 'customizer-options';
return $classes;
}