Skip to content

Instantly share code, notes, and snippets.

@patric-boehner
patric-boehner / code-functions.php
Last active July 16, 2019 17:27 — forked from jdelia/code-functions.php
SVG Icons and Graphic Elements
// Add the SVG icons functions.
include_once( get_stylesheet_directory() . '/lib/icon-functions.php' );
@patric-boehner
patric-boehner / genesis-no-posts.php
Last active October 5, 2017 19:11
Change how the Genesis framework handels the else at the end of a loop when no posts are found. Genesis only provides a filter for the text, but that text also contains the main structure. This snippet removed and receates that function.
<?php
/**
* Update Genesis No Post Text
*
* @package Child Theme
* @author Patrick Boehner
* @copyright Copyright (c) 2017, Patrick Boehner
* @license GPL-2.0+
*
@patric-boehner
patric-boehner / menu-title.php
Last active September 26, 2017 06:19
Get the Title of a menu based on theme location
<?php
//* Don't include the opening tag
$theme_location = 'featured';
$theme_locations = get_nav_menu_locations();
$nav_menu_ID = $theme_locations[$theme_location];
$nav_menu_title = wp_get_nav_menu_object( $nav_menu_ID );
if ( has_nav_menu( 'featured' ) ) {
@patric-boehner
patric-boehner / add_js_body_class.php
Last active September 24, 2017 19:39
Adds a small inline script to append `js` class to body tag if JavaScript is enabled in Genesis theme
<?php
/**
* Script sample comes from WP SiteCare's carelib
* https://github.com/wpsitecare/carelib
*
* A simplified version of Gary Jones Genesis JS
* https://github.com/GaryJones/genesis-js-no-js/
*
* This produces what the Genesis Sample Theme does in the
@patric-boehner
patric-boehner / recent-post.php
Last active September 21, 2017 02:12
Recent Post Excerpt Widget
<?php
/**
* Recent post excerpt widget
*
* @package CoreFunctionality
* @author Patrick Boehner <[email protected]>
* @since 1.0.1
* @copyright Copyright (c) 2016, Patrick Boehner
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@patric-boehner
patric-boehner / _socia-share-links.sass
Last active October 8, 2017 01:32
Simple Social Share links for use within Genesis child theme.
@patric-boehner
patric-boehner / login.php
Last active September 26, 2017 06:24
Customizing Wordpress Login
<?php
/**
* Login Page customizations
*
* This file adds the necessary functions and stylesheets to customize the login page.
*
* @package Theme Name
* @author Patrick Boehner <[email protected]>
* @link https://
@patric-boehner
patric-boehner / social-link-widget.php
Last active September 18, 2017 06:27
Social Media Link Widget with Icons
@patric-boehner
patric-boehner / hide-editor.php
Created February 24, 2017 03:11 — forked from ramseyp/hide-editor.php
Hide the content editor for certain pages in WordPress
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.
@patric-boehner
patric-boehner / slick-slider-fade.js
Created January 13, 2017 09:27
Slick Slider Don't Show Till Loaded and Fade In
var $slider = $('.homepage-slidehsow')
.on('init', function(slick) {
// Just checking if its running
console.log('fired!');
// Fade in containing element for slick slider
$('.homepage-slidehsow').fadeIn(900);
})