Skip to content

Instantly share code, notes, and snippets.

@JanHoek
JanHoek / functions.php
Created May 18, 2014 15:44
Create a Widget Area with Featured image as background for Genesis
<?php // remove this line
// Register OnTop Widget
genesis_register_sidebar( array(
'id' => 'ontop',
'name' => __( 'OnTop', 'jan' ),
'description' => __( 'This the Ontop widget', 'jan' ),
) );
@JanHoek
JanHoek / featurebg.css
Created May 18, 2014 15:53
CSS for a Widget Area with Featured image as background
.features {
background: url(images/default-featurebg.jpg) no-repeat center top;
clear: both;
min-height: 450px;
padding: 2%;
}
features-widgetarea {
padding: 2%;
float: right;
@JanHoek
JanHoek / jangist005.php
Created May 30, 2014 17:41
Show manual excerpt after the header on any Page or Post in Genesis
<?php // remove this line
//* Activate Manual excerpt on Pages
add_post_type_support('page', 'excerpt');
//* Show Manual excerpt After Header
function jan_show_manual_excerpt() {
$post = get_post( get_the_ID() );
@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;
}
// 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 / 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 );
@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 = '…' );