Skip to content

Instantly share code, notes, and snippets.

View lukecav's full-sized avatar
🪨
Words of encouragement

Luke Cavanagh lukecav

🪨
Words of encouragement
View GitHub Profile
@lukecav
lukecav / woologin.php
Created October 6, 2016 02:04 — forked from neilgee/woologin.php
WooCommerce MyAccount Login/Logout to Menu
<?php //<~ don't add me in
add_filter( 'wp_nav_menu_items', 'my_account_loginout_link', 10, 2 );
/**
* Add WooCommerce My Account Login/Logout to Menu
*
* @see https://support.woothemes.com/hc/en-us/articles/203106357-Add-Login-Logout-Links-To-The-Custom-Primary-Menu-Area
*/
function my_account_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'primary') { //change your theme location menu to suit
@lukecav
lukecav / comments-removal.php
Created October 6, 2016 02:05 — forked from neilgee/comments-removal.php
Remove Comments based on Category
<?php //<~ don't add me in
add_action( 'genesis_before_entry', 'wpb_remove_comments_category' );
function wpb_remove_comments_category() {
if ( !in_category( 38 ) ) {//adjust your Category ID's in the conditional
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' );
}
}
@lukecav
lukecav / svg-images.php
Created October 6, 2016 02:08 — forked from neilgee/svg-images.php
Add SVG to WordPress via Media Uploader
<?php // <~ don't add me in
add_filter('mime_types', 'themeprefix_add_svg_images');
//Allow SVG Images Via Media Uploader
function themeprefix_add_svg_images($mimetypes) {
$mimetypes['svg'] = 'image/svg+xml';
return $mimetypes;
}
@lukecav
lukecav / remove-genesis-blogpage-settings.php
Created October 6, 2016 02:25 — forked from BeardedGinger/remove-genesis-blogpage-settings.php
Remove the Genesis Blog Page settings from the Genesis Theme Settings page
<?php
add_action( 'toplevel_page_genesis_settings_page_boxes', 'lc_remove_unwanted_genesis_metaboxes' );
/**
* Remove the blog page settings metabox from the Genesis Theme Settings
* Desired if following the suggestion by Bill Erickson to not use the Blog page template
* that comes standard in the Genesis Theme
*
* @link http://www.billerickson.net/dont-use-genesis-blog-template/
*/
function lc_remove_unwanted_genesis_metaboxes() {
@lukecav
lukecav / WooCommerce Template
Created October 6, 2016 02:26 — forked from BeardedGinger/WooCommerce Template
WooCommerce Template page for Genesis Child Theme
<?php
/**
* WooCommerce Template
*
* Template used for all WooCommerce views for your site
*
*/
//* Remove standard post content output
remove_action( 'genesis_loop', 'genesis_do_loop');
@lukecav
lukecav / jetpack-social-buttons-css
Created October 7, 2016 21:22 — forked from renventura/jetpack-social-buttons-css
Jetpack Social Share Buttons CSS
div.sharedaddy div.sd-block {
border-top: 1px solid rgba(0,0,0,0.13);
border-top-width: 1px;
border-top-style: solid;
border-top-color: rgba(0,0,0,0.13);
padding: 0;
}
.single-format-quote div.sharedaddy div.sd-block {
display: none;
@lukecav
lukecav / genesis-post-info-with-est-read-time.php
Created October 7, 2016 21:25 — forked from renventura/genesis-post-info-with-est-read-time.php
Modified Genesis post info with estimated read time
<?php //* Mind this opening php tag
/**
* Display Last Updated date if a post has been updated (Genesis Framework)
* Includes estimated read time via the Estimated Post Reading Time plugin
*
* @author Ren Ventura <EngageWP.com>
* @link http://www.engagewp.com/display-updated-date-instead-of-published-date-in-genesis/
*/
add_filter( 'genesis_post_info', 'rv_post_info_filter_with_est_read_time' );
@lukecav
lukecav / previous-next-post-permalink.php
Created October 7, 2016 21:25 — forked from renventura/previous-next-post-permalink.php
Get the WordPress permalink for previous and next posts
<?php //* Mind this opening PHP tag
/**
* Get previous and next post permalinks
*/
get_permalink( get_adjacent_post()->ID ); # Previous
get_permalink( get_adjacent_post( false, '', false )->ID ); # Next
@lukecav
lukecav / remove-logout-link-wp-comment-form.php
Created October 7, 2016 21:28 — forked from renventura/remove-logout-link-wp-comment-form.php
Remove the "Logged in as {username}. Log Out?" link from the WordPress comment form.
<?php
/*
Plugin Name: WPMDB Pro Migration Complete Notifications
Plugin URI: http://deliciousbrains.com
Description: Get notified when a migration completes
Author: Delicious Brains
Version: 0.0
Author URI: http://deliciousbrains.com
*/