-
-
Save anonymous/d7edbdeeadbb82e803c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Start the engine | |
include_once( get_template_directory() . '/lib/init.php' ); | |
//* Child theme (do not remove) | |
define( 'CHILD_THEME_NAME', 'Minimalist Theme' ); | |
define( 'CHILD_THEME_URL', 'http://briangardner.com/themes/minimalist/' ); | |
define( 'CHILD_THEME_VERSION', '1.0.1' ); | |
//* Enqueue scripts and styles | |
add_action( 'wp_enqueue_scripts', 'minimalist_scripts_styles' ); | |
function minimalist_scripts_styles() { | |
wp_enqueue_script( 'minimalist-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); | |
wp_enqueue_style( 'dashicons' ); | |
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Crimson+Text:400,400italic,600', array(), CHILD_THEME_VERSION ); | |
} | |
//* Add HTML5 markup structure | |
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); | |
//* Add viewport meta tag for mobile browsers | |
add_theme_support( 'genesis-responsive-viewport' ); | |
//* Add support for custom header | |
add_theme_support( 'custom-header', array( | |
'width' => 720, | |
'height' => 85, | |
'header-selector' => '.site-title a', | |
'header-text' => false, | |
'flex-height' => true, | |
) ); | |
//* Add support for custom background | |
add_theme_support( 'custom-background' ); | |
//* Unregister Genesis widgets | |
add_action( 'widgets_init', 'minimalist_unregister_genesis_widgets', 20 ); | |
function minimalist_unregister_genesis_widgets() { | |
unregister_widget( 'Genesis_Featured_Page' ); | |
unregister_widget( 'Genesis_Featured_Post' ); | |
unregister_widget( 'Genesis_User_Profile_Widget' ); | |
} | |
//* Unregister layout settings | |
genesis_unregister_layout( 'content-sidebar' ); | |
genesis_unregister_layout( 'sidebar-content' ); | |
genesis_unregister_layout( 'content-sidebar-sidebar' ); | |
genesis_unregister_layout( 'sidebar-sidebar-content' ); | |
genesis_unregister_layout( 'sidebar-content-sidebar' ); | |
//* Unregister sidebars | |
unregister_sidebar( 'sidebar' ); | |
unregister_sidebar( 'sidebar-alt' ); | |
//* Reduce the primary navigation menu to one level depth | |
add_filter( 'wp_nav_menu_args', 'minimalist_primary_menu_args' ); | |
function minimalist_primary_menu_args( $args ){ | |
if( 'primary' != $args['theme_location'] ) | |
return $args; | |
$args['depth'] = 1; | |
return $args; | |
} | |
//* Remove secondary navigation menu | |
add_theme_support( 'genesis-menus', array( 'primary' => __( 'Primary Navigation Menu', 'genesis' ) ) ); | |
//* Force full-width-content layout setting | |
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); | |
//* Remove the header right widget area | |
unregister_sidebar( 'header-right' ); | |
//* Customize the entry meta in the entry header | |
add_filter( 'genesis_post_info', 'minimalist_entry_meta_header' ); | |
function minimalist_entry_meta_header($post_info) { | |
$post_info = '[post_date] by [post_author_posts_link] [post_edit]'; | |
return $post_info; | |
} | |
//* Modify the size of the Gravatar in the author box | |
add_filter( 'genesis_author_box_gravatar_size', 'minimalist_author_box_gravatar' ); | |
function minimalist_author_box_gravatar( $size ) { | |
return 170; | |
} | |
//* Modify the size of the Gravatar in the entry comments | |
add_filter( 'genesis_comment_list_args', 'minimalist_comments_gravatar' ); | |
function minimalist_comments_gravatar( $args ) { | |
$args['avatar_size'] = 100; | |
return $args; | |
} | |
//* Remove comment form allowed tags | |
add_filter( 'comment_form_defaults', 'minimalist_remove_comment_form_allowed_tags' ); | |
function minimalist_remove_comment_form_allowed_tags( $defaults ) { | |
$defaults['comment_notes_after'] = ''; | |
return $defaults; | |
} | |
/** | |
* Add prev and next links to a numbered link list | |
* http://wordpress.stackexchange.com/questions/37256/paged-posts-how-to-use-numbers-and-next-previous-links | |
*/ | |
add_filter('wp_link_pages_args', 'abte_genesis_style_page_post_pagination'); | |
function abte_genesis_style_page_post_pagination($args) { | |
global $page, $numpages, $more, $pagenow; | |
if (!$args['next_or_number'] == 'next_and_number') | |
return $args; # exit early | |
$args['next_or_number'] = 'number'; # keep numbering for the main part | |
if (!$more) | |
return $args; # exit early | |
if($page-1) # there is a previous page | |
$args['before'] .= _wp_link_page($page-1) . $args['link_before'] . $args['previouspagelink'] . $args['link_after'] . '</a>'; | |
if ($page<$numpages) # there is a next page | |
$args['after'] = _wp_link_page($page+1) . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '</a>' . $args['after']; | |
return $args; | |
} | |
add_action( 'wp_enqueue_scripts', 'youruniqueprefix_load_scripts' ); | |
function youruniqueprefix_load_scripts() { | |
wp_enqueue_style( 'youruniqueprefix-fontawesome' , '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' ); // font awesome css from cdn | |
} | |
//* Enqueue dashicons | |
add_action( 'wp_enqueue_scripts', 'bg_enqueue_dashicons' ); | |
function bg_enqueue_dashicons() { | |
// Enqueue dashicons | |
wp_enqueue_style( 'dashicons' ); | |
} | |
//* Enqueue Dashicons | |
add_action( 'wp_enqueue_scripts', 'enqueue_dashicons' ); | |
function enqueue_dashicons() { | |
wp_enqueue_style( 'dashicons' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment