Skip to content

Instantly share code, notes, and snippets.

View duroe5698's full-sized avatar

Marc Duroe duroe5698

View GitHub Profile
@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 / 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 / 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-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 / 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 / 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 / customize-genesis-footer-text-snippet.php
Last active August 2, 2017 21:22
Customize Genesis Footer Text Genesis Framework Snippet