Skip to content

Instantly share code, notes, and snippets.

//* Setup widget counts
function dynamik_count_widgets( $id ) {
global $sidebars_widgets;
if ( isset( $sidebars_widgets[ $id ] ) ) {
return count( $sidebars_widgets[ $id ] );
}
}
@SiGaCode
SiGaCode / footer_styling_01.php
Created January 18, 2015 09:46
Credits: Junior Atoms / Larry: http://cobaltapps.com/forum/forum/dynamik-skin-forums/tools-tips-other-skin-resources-aa/49313-fun-with-footer This removes the Genesis footer text, adds a single level menu, widget-area and automatic copyright to the footer. Be sure to add paragraphs to the Footer Text widget area, or else it won't pick up any sty…
/* Beaver Builder */
.beaver-page.fl-builder .content,
.beaver-page.fl-builder .content .page,
.beaver-page.fl-builder .content-sidebar-wrap,
.beaver-page.fl-builder .site-container,
.beaver-page.fl-builder .site-inner {
background: none;
border: 0;
float: none;
@SiGaCode
SiGaCode / commentform_columns.js
Last active August 29, 2015 14:15
Display author, email and URL in three columns. NOTE: Does not work with certain antispam plugins! Additional custom CSS needed.
jQuery(document).ready(function($){
// Two Column Comment Form
// Author: Bill Erickson
// URL: http://www.billerickson.net/code/two-column-comment-form/
if( $('.comment-form-author').length ) {
$('.comment-form').prepend( '<div class="ez-only comment-form-full" />' );
$('.comment-form').prepend( '<div class="one-third comment-form-right" />' );
$('.comment-form').prepend( '<div class="one-third comment-form-middle" />' );
$('.comment-form').prepend( '<div class="one-third first comment-form-left" />' );
@SiGaCode
SiGaCode / create_wrapped_widget.php
Created February 18, 2015 19:32
Functions: Create a widget area and wrap it in divs.
genesis_register_sidebar( array(
'id' => 'widget-drawer',
'name' => __( 'Big Menu', 'dynamik-gen' ),
'description' => __( 'This is the widget area for the big menu.', 'dynamik-gen' ),
) );
//* Hook the widget-drawer-area to after_header
add_action( 'genesis_after_header', 'dynamik_big_menu', 10 );
function dynamik_big_menu() {
@SiGaCode
SiGaCode / toggle_div.js
Last active August 29, 2015 14:15
Toggle a certain div with click on a trigger link (similar to mobile toggle) - with example CSS
/* needs a link with class .drawer-toggle and a div .widget-drawer*/
jQuery(document).ready(function(){
jQuery(".drawer-toggle").click(function(){
jQuery(".widget-drawer").slideToggle("slow");
});
});
//*Alternative version with auto-link in site-title area:
( function( $ ) {
//* Create a custom header and menu
//* Remove header
remove_action('genesis_header', 'genesis_header_markup_open', 5);
remove_action('genesis_header', 'genesis_do_header');
remove_action('genesis_header', 'genesis_header_markup_close', 15);
//* Unregister header-right widget-area
unregister_sidebar( 'header-right' );
@SiGaCode
SiGaCode / filter_post_title.php
Created March 1, 2015 12:07
Filter a genesis post/page title to add a span for styling (in single view). Goes to Dynamik Custom - Functions Credits: http://adamcap.com/code/filter-genesis-h1-post-titles-to-add-for-styling/
/**
* Filter Genesis H1 Post Titles to add <span> for styling
*
*/
add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 );
function ac_post_title_output( $title ) {
if ( is_singular() )
$title = sprintf( '<h1 class="entry-title"><span>%s</span></h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
return $title;
}
@SiGaCode
SiGaCode / body_featured_image.php
Last active August 29, 2015 14:17
Use different featured images as a body background for different pages Credits: https://journalxtra.com/wordpress/quicksnips/use-wordpress-featured-image-post-page-background-picture/ You can set a "default" body background image in Dynamik Design - Body. It will be displayed when no featured image available.
@SiGaCode
SiGaCode / custom_body_attributes.php
Created March 15, 2015 18:21
Custom body attributes (change filter to apply to any other element) Credits: http://wpbeaches.com/adding-attribute-html-section-genesis/
add_filter( 'genesis_attr_body', 'custom_add_css_attr' );
function custom_add_css_attr( $attributes ) {
// add original plus extra CSS classes
$attributes['class'] .= ' parallax';
$attributes['data-diff'] = '100';
// return the attributes
return $attributes;
}