Skip to content

Instantly share code, notes, and snippets.

@JanHoek
JanHoek / header-menu-columns.css
Created September 2, 2014 20:54
Multi Column Genesis Header Navigation
.nav-header a {
padding: 4px;
}
.nav-header .genesis-nav-menu > .menu-item {
width: 33%;
float:left;
}
@media only screen and (max-width: 1023px) {
@JanHoek
JanHoek / to-top-functions.php
Last active May 10, 2019 04:34
Simple en smooth Back-To-Top button for Genesis
<?php //* Don't copy the php
// Enqueue To Top script
add_action( 'wp_enqueue_scripts', 'to_top_script' );
function to_top_script() {
wp_enqueue_script( 'to-top', get_stylesheet_directory_uri() . '/js/to-top.js', array( 'jquery' ), '1.0', true );
}
// Add To Top button
add_action( 'genesis_before', 'genesis_to_top');
@JanHoek
JanHoek / add-responsive-toggle.php
Last active May 1, 2021 09:07
Pure CSS Responsive Menus For Genesis
<?php //* Don't copy the php
//* Activate the use of Dashicons
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}
//* Add Extra div to nav for responsive menu
@JanHoek
JanHoek / accessible-read-more.php
Last active April 20, 2017 16:05
Accessible “Read More” links for Genesis
<?php //* Don't copy the php
//* Accessible Read More links for Genesis
add_filter('excerpt_more', 'jan_read_more_link');
add_filter( 'the_content_more_link', 'jan_read_more_link' );
function jan_read_more_link() {
$trimtitle = get_the_title();
$shorttitle = wp_trim_words( $trimtitle, $num_words = 5, $more = '…' );
@JanHoek
JanHoek / genesis-shortcode-handler.php
Last active January 29, 2017 16:38
Simple Genesis Columns Shortcode Handler
<?php
//*shortcode handler for columnization
//* One Half
function shortcode_half_first( $atts, $content = null ) {
$content = wptexturize( $content );
$content = wpautop( $content );
// Enqueue Scripts/Styles for our Lightbox
function child_theme_add_lightbox() {
wp_enqueue_script( 'fancybox', get_bloginfo( 'stylesheet_directory' ) . '/js/jquery.fancybox.pack.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'lightbox', get_bloginfo( 'stylesheet_directory' ) . '/js/lightbox.js', array( 'fancybox' ), false, true );
wp_enqueue_style( 'lightbox-style', get_bloginfo( 'stylesheet_directory' ) . '/css/jquery.fancybox.css' );
}
add_action( 'wp_enqueue_scripts', 'child_theme_add_lightbox' );
@JanHoek
JanHoek / font-awesome-menu.css
Last active February 23, 2017 13:03
Add Font Awesome Icons to the Genesis Menus
/*
Font Awesome Primary Menu
---------------------------------------------------------------------------------------------------- */
.genesis-nav-menu a {
line-height: 1;
padding-left: 30px;
color: #fff;
}