Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
define('FORCE_SSL_ADMIN' , true);
@danielmcclure
danielmcclure / Disable File Editing from WordPress Dashboard
Created August 22, 2014 02:07
Disable File Editing from WordPress Dashboard
define('DISALLOW_FILE_EDIT' , true);
@danielmcclure
danielmcclure / Force Two Column WordPress Dashboard
Created August 22, 2014 04:38
Force Two Column WordPress Dashboard
//* Add Dashboard Column Settings
function bm_custom_dashboard_columns() {
add_screen_option(
'layout_columns',
array(
'max' => 2,
'default' => 1
)
);
}
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}
@danielmcclure
danielmcclure / Google Fonts for WordPress
Created October 28, 2014 08:47
Add Google Fonts to WordPress
/**
* Additional Styles
* @since 1.0.0
*/
function font_styles() {
if ( !is_admin() ) {
// register styles
wp_register_style('googlefonts', 'http://fonts.googleapis.com/css?family=Oswald:400,300,700', array(), false, 'all');
@danielmcclure
danielmcclure / remove-attribution.php
Created December 10, 2014 00:24
Removes the attribution link from the Thesis Theme
<?php
/* Remove Thesis Attribution Link (Developer License Holders Only) */
remove_action('thesis_hook_footer', 'thesis_attribution');
@danielmcclure
danielmcclure / robots.txt
Created December 10, 2014 00:38
Block search engines from accessing WordPress system files.
User-Agent: *
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /wp-includes/
@danielmcclure
danielmcclure / custom_functions.php
Created December 10, 2014 03:54
Move the Thesis Navigation bar below the header
<?php
/* Move Thesis Navigation Below Header */
remove_action('thesis_hook_before_header' , 'thesis_nav_menu');
add_action('thesis_hook_after_header', 'thesis_nav_menu');
<?php
//* Do NOT include the opening php tag
//* Unregister primary sidebar
unregister_sidebar( 'sidebar' );
<?php
//* Do NOT include the opening php tag
//* Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout setting