Skip to content

Instantly share code, notes, and snippets.

View duroe5698's full-sized avatar

Marc Duroe duroe5698

View GitHub Profile
@duroe5698
duroe5698 / customize-genesis-footer-text-snippet.php
Last active August 2, 2017 21:22
Customize Genesis Footer Text Genesis Framework Snippet
@duroe5698
duroe5698 / featured-image-single-posts-genesis-snippet.php
Last active November 25, 2015 17:24
Display Featured Image floated to the left in single Posts for Genesis Framework Snippet
@duroe5698
duroe5698 / unregister-genesis-layout-options-snippet.php
Last active November 25, 2015 17:23
Unregister Layout Options For Genesis Framework Snippet
<?php
//* Unregister content/sidebar layout setting
genesis_unregister_layout( 'content-sidebar' );
//* Unregister sidebar/content layout setting
genesis_unregister_layout( 'sidebar-content' );
//* Unregister content/sidebar/sidebar layout setting
genesis_unregister_layout( 'content-sidebar-sidebar' );
@duroe5698
duroe5698 / remove-all-page-titles-exclude-blog-and-archive-pages-genesis-framework.php
Last active November 25, 2015 17:23
Remove All Page Titles Exclude Blog and Archive Pages Genesis Framework Snippet
<?php
//* Remove titles on pages only
function remove_page_titles_genesis() {
if ( is_page() && !is_archive() && !is_page_template('page_blog.php') || $post->post_parent ) {
remove_action('genesis_entry_header', 'genesis_do_post_title');
}}
add_action ('get_header', 'remove_page_titles_genesis');
?>
@duroe5698
duroe5698 / Add-post-category-slug-as-body-class.php
Last active November 25, 2015 17:23
Add Post Category Slug as Body Class WordPress Snippet
<?php
function add_category_name($classes = '') {
if(is_single()) {
$category = get_the_category();
$classes[] = 'category-'.$category[0]->slug;
}
return $classes;
}
add_filter('body_class','add_category_name');
?>
@duroe5698
duroe5698 / remove-standard-and-load-custom-genesis-sidebar.php
Last active April 2, 2018 03:48
Remove Primary Sidebar and Replace with Custom Sidebar Genesis Framework Snippet
<?php
//* Insert into custom page template to remove primary sidebar and replace with your custom sidebar.
function md_do_sidebar() {
dynamic_sidebar( 'SIDEBAR ID' );
}
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'md_do_sidebar' );
?>
@duroe5698
duroe5698 / custom-wordpress-admin-styles.php
Last active November 25, 2015 17:22
Create custom admin styles for WordPress dashboard
<?php
add_action('admin_head', 'md_custom_user_panel');
function md_custom_user_panel() {
global $current_user;
get_currentuserinfo();
if ( USER ID == $current_user->ID ) {
echo '<style>
YOUR CUSTOM ADMIN STYLES HERE
@duroe5698
duroe5698 / Relocating entry-title-below-header-in-genesis-functions.php
Last active November 25, 2015 17:21
Relocating Entry Title below Header in Genesis
<?php
// * Relocate titles on Page, Post and other single pages
add_action( 'genesis_after_header','relocate_entry_title_singular' );
function relocate_entry_title_singular() {
if ( ! is_singular() )
return;
echo '<div class="entry-header-wrapper"><div class="wrap">';
genesis_do_post_title();
genesis_post_info();
@duroe5698
duroe5698 / hide-wordpress-plugin-update-notice.php
Last active November 25, 2015 17:21
Hide WordPress plugin update notice from admin
<?php
function md_filter_plugin_updates( $value ) {
if( isset( $value->response[ plugin_basename(__FILE__) ] ) )
unset( $value->response[ plugin_basename(__FILE__) ] ); //Duplicator
return $value;
}
add_filter( 'site_transient_update_plugins', 'md_filter_plugin_updates' );
?>
@duroe5698
duroe5698 / match-sidebar-to-content-height-genesis.js
Last active June 21, 2016 19:34
Match sidebar to content height Genesis
jQuery(function($){
var h = document.querySelector('.content').offsetHeight;
document.querySelector('.sidebar-primary').style.height = h + "px";
});