This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hale2015/functions.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
102 lines (84 sloc)
2.78 KB
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 | |
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 99 ); | |
function theme_enqueue_styles() { | |
$stylesheet = get_theme_mod('themeColor'); | |
if( $stylesheet ){ | |
wp_enqueue_style( $stylesheet, get_stylesheet_directory_uri() . '/css/'.$stylesheet.'.css', array('cs-style') ); | |
} else { | |
wp_enqueue_style( 'hale2015-blue', get_stylesheet_directory_uri() . '/css/hale2015-blue.css', array('cs-style') ); | |
} | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
$maxMegaMenuActive = is_plugin_active('megamenu/megamenu.php'); | |
if ($maxMegaMenuActive){ | |
wp_dequeue_style( 'cs-megamenu' ); | |
wp_enqueue_style( 'megamenu-hale2015', get_stylesheet_directory_uri(). '/css/megamenu-hale2015.css', array( 'cs-style' )); | |
}; | |
} | |
add_action( 'wp_print_styles', 'deregister_cs_styles', 100 ); | |
function deregister_cs_styles() { | |
wp_deregister_style( 'cs-megamenu' ); | |
} | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
$maxMegaMenuActive = is_plugin_active('megamenu/megamenu.php'); | |
if ($maxMegaMenuActive){ | |
wp_enqueue_style( 'hale2015-megamenu', get_stylesheet_directory_uri(). '/css/megamenu-hale2015.css', array( 'hale2015-style' )); | |
}; | |
function show_people(){ | |
if ( !is_plugin_active('uc-people/uc-people.php') ) { | |
activate_plugin('uc-people/uc-people.php'); | |
} | |
}; | |
add_action( 'after_switch_theme', 'show_people' ); | |
function hide_people(){ | |
if ( is_plugin_active('uc-people/uc-people.php') ) { | |
deactivate_plugins('uc-people/uc-people.php'); | |
} | |
}; | |
add_action( 'switch_theme', 'hide_people' ); | |
function hide_uup(){ | |
global $wp_themes; | |
if ( is_plugin_active('uup/uup.php') ) { | |
remove_shortcode('uc_uup'); | |
} | |
}; | |
add_action( 'init', 'hide_uup' ); | |
function tfc_remove_page_templates( $templates ) { | |
unset( $templates['page-user-profile.php'] ); | |
unset( $templates['user-index-table.php'] ); | |
unset( $templates['user-index.php'] ); | |
return $templates; | |
} | |
add_filter( 'theme_page_templates', 'tfc_remove_page_templates' ); | |
// Color Options | |
function husky2015_customize_register( $wp_customize ) { | |
$wp_customize->add_section( 'colors' , array( | |
'title' => __( 'Colors', 'husky2015' ), | |
'priority' => 30, | |
) ); | |
$wp_customize->add_setting( 'themeColor', | |
array( | |
'default' => 'hale2015-blue', | |
'type' => 'theme_mod', | |
'capability' => 'edit_theme_options', | |
'transport' => 'refresh' | |
) | |
); | |
$wp_customize->add_control( | |
'color_control', | |
array( | |
'label' => __( 'Theme Color', 'husky2015' ), | |
'section' => 'colors', | |
'settings' => 'themeColor', | |
'type' => 'radio', | |
'choices' => array( | |
'hale2015-blue' => 'Blue', | |
'hale2015-red' => 'Red', | |
'hale2015-orange' => 'Orange', | |
'hale2015-green' => 'Green', | |
'hale2015-purple' => 'Purple', | |
), | |
) | |
); | |
} | |
add_action( 'customize_register', 'husky2015_customize_register' ); | |
?> |