Skip to content

Instantly share code, notes, and snippets.

@SiGaCode
SiGaCode / sample-resp-menu.js
Created September 10, 2016 10:15
Accessibility-ready responsive menu for Genesis Sample theme by Bradley Potter. Combines all the menus to one for mobiles. https://gist.githubusercontent.com/bradpotter/d8eb59e814c3838a28773152563d5fbc/raw/2bb10160a0b4e3ccc1b6eb89784d55ee104f2f65/responsive-menu.js
/**
* Accessibility-ready responsive menu.
*/
( function ( document, $, undefined ) {
$( 'body' ).addClass( 'js' );
'use strict';
@SiGaCode
SiGaCode / title-bc-same-div.php
Created September 6, 2016 09:01
Title and breadcrumbs sharing same div in Genesis (sample, needs to be edited). Credits: https://gist.github.com/chillybin/484e75a6bccb42167a69ee8d0b54a6f6 (Nicol Shaan)
<?
//* Remove Page Title
add_action( 'get_header', 'remove_titles_all_single_pages' );
function remove_titles_all_single_pages() {
if ( is_singular('page') ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
} if (is_singular('post')) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
@SiGaCode
SiGaCode / slider-widget.php
Created July 30, 2016 21:38
Widget area before content for a slider in Lifestyle Pro
genesis_register_sidebar( array(
'id' => 'slider-widget',
'name' => __( 'Slider-Widget', 'lifestyle' ),
'description' => __( 'This is the widget area for the slider.', 'lifestyle' ),
) );
//* Hook the widget to before content
add_action( 'genesis_before_content', 'my-slider', 10 );
@SiGaCode
SiGaCode / amare-button.css
Last active March 8, 2017 14:46
AMARE Dynamik Skin Code Snippets: Widget content samples, CSS samples, video shortcode....
a.button{
background: #C31B42;
color: #FFFFFF !important;
display: inline-block;
font-family: inherit;
font-size: inherit;
margin: 10px 0;
padding: 10px 20px;
border:1px solid #911D00;
border-radius: 5px;
@SiGaCode
SiGaCode / menu-gap.css
Created July 25, 2016 19:19
The Genesis menu item gap - unfortunately in Dynamik. Remove the main background color of any menu and let the single menu items have their own and you´ll see it. Here´s how you can get rid of it. Credits to robneu: https://gist.github.com/robneu/0ad283737d80802cb0e0
/* This is for a primary nav - use the same font-size you set in DWB dashboard. */
/* Change second selector for Primary Nav to: .site-header .genesis-nav-menu .menu-item */
/* Change second selector for Header Right Nav to: .nav-secondary .menu-item */
.genesis-nav-menu {
font-size: .001px;
}
.nav-primary .menu-item {
font-size: 2rem;
@SiGaCode
SiGaCode / hamburger-function.php
Last active July 21, 2016 20:58
Always hamburger (hamburger icon on desktops) for a header right menu. Dynamik solution without plugin.
//* Goes to Dynamik Design - Skins - Your Skin - PHP (AFTER line 45, read bottom comments)
//* Reposition the primary mobile nav inside header, so we can align hamburger and title/logo side by side
remove_action( 'genesis_after_header', 'dynamik_mobile_nav_1', 9 );
add_action( 'genesis_header', 'dynamik_mobile_nav_1', 9 );
@SiGaCode
SiGaCode / freshly-banner-styles.css
Created July 21, 2016 17:51
Add the home banner that is shown in the Freshly skin preview but missing in the skin (CSS was implemented, though) as a widget area to the skin functions (PHP). Goes to Dynamik Design - Skins - Freshly (or your re-named skin) - PHP. Add AFTER: /*** END CORE SKIN FUNCTIONS Below you may include additional Skin functions. ***/
/* Add in skin - CSS only if not present yet (in older versions it is) and edit to suit your needs*/
.freshly-home-banner {
background: #07B3D5;
width: 100%;
color: #FFFFFF;
font-size: 30px;
font-size: 3rem;
font-family: "Raleway", sans-serif;
font-style: italic;
float: left;
@SiGaCode
SiGaCode / scroll-to-top-script.js
Created July 21, 2016 17:19
The Scroll-to-Top button, skin-integrated (exportable) and using Font-Awesome icon instead of an image. Needs the checkbox to be checked in Dynamik Design - Body - Add Support For Font Awesome Icons
// Goes to Dynamik Design - Skins - Your Skin - JS after the comments
jQuery(document).ready(function($) {
//Scroll to top button
$(window).scroll(function(){
if ($(this).scrollTop() > 200) {
$('.up').fadeIn();
} else {
$('.up').fadeOut();
}
@SiGaCode
SiGaCode / read-more-standard.php
Last active February 8, 2017 12:46
Check for the default <!--more--> and change it but leave custom <!--more Custom Text--> alone (c) Christina Arasmo: https://gist.github.com/carasmo/5e9781c3fd37fa9ef29d67f4c8157657
//*Custom Read More link.
add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {
return ' ... <br><a class="more-link button blog" href="' . get_permalink() . '" rel="nofollow">Custom Read More</a>';
}
@SiGaCode
SiGaCode / inline-script.php
Created June 26, 2016 13:00
If you’re enqueuing a script that requires additional Javascript to run properly (ex: targeting the proper div for your carousel and adding parameters), add that as an inline script rather than creating a separate JS file. (c) Bill Erickson, http://www.billerickson.net/code/add-inline-script/
<?php
$gallery = ea_cf( 'ea_product_gallery' );
if( $gallery ) {
wp_enqueue_script( 'slick' );
wp_add_inline_script( 'slick', 'jQuery(document).ready(function($){$(".product-gallery").slick({autoplay: false, arrows: false, dots: true, });});' );
// output gallery
}