Initial custom color.

This commit is contained in:
Fabiano Alencar 2018-02-28 13:55:04 -03:00
parent 84f8038249
commit dcf303ed2c
4 changed files with 45 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
require get_template_directory() . '/functions/setup.php'; require get_template_directory() . '/functions/setup.php';
require get_template_directory() . '/functions/customize.php';
require get_template_directory() . '/functions/enqueues.php'; require get_template_directory() . '/functions/enqueues.php';
require get_template_directory() . '/functions/pagination.php'; require get_template_directory() . '/functions/pagination.php';

View File

@ -0,0 +1,31 @@
<?php
if ( ! function_exists( 'tainacan_header_style' ) ) :
function tainacan_header_style() {
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail.
if ( $text_color == HEADER_TEXTCOLOR )
return;
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css" id="tainacan-header-css">
<?php
// Has the text been hidden?
if ( '212529' == $text_color ) :
?>
body{
color = #212529;
}
<?php
// If the user has set a custom color for the text use that
else :
?>
body {
color: #<?php echo $text_color; ?>;
}
<?php endif; ?>
</style>
<?php
}
endif; // tainacan_header_style

View File

@ -30,10 +30,10 @@ if ( ! function_exists('tainacan_Enqueues') ) {
/** /**
* Google Charts * Google Charts
* wp_register_script( 'googleCharts', 'https://www.gstatic.com/charts/loader.js');
* wp_enqueue_script('googleCharts');
*/ */
wp_register_script( 'googleCharts', 'https://www.gstatic.com/charts/loader.js');
wp_enqueue_script('googleCharts');
/** /**
* Tainacan Theme * Tainacan Theme
*/ */
@ -43,7 +43,6 @@ if ( ! function_exists('tainacan_Enqueues') ) {
wp_enqueue_script('tainacanJS'); wp_enqueue_script('tainacanJS');
wp_register_script('collectionGraph_googleCharts', get_template_directory_uri() . '/assets/js/charts.js', array('googleCharts'), '1.0'); wp_register_script('collectionGraph_googleCharts', get_template_directory_uri() . '/assets/js/charts.js', array('googleCharts'), '1.0');
wp_enqueue_script('collectionGraph_googleCharts'); wp_enqueue_script('collectionGraph_googleCharts');
/** /**
* Comments * Comments
*/ */

View File

@ -16,6 +16,16 @@ if(!function_exists('tainacan_setup')) {
**/ **/
show_admin_bar( false ); show_admin_bar( false );
$custom_header_support = array(// The default header text color.
'default-text-color' => '212529',
'wp-head-callback' => 'tainacan_header_style',
);
add_theme_support( 'custom-header', $custom_header_support );
if ( ! function_exists( 'get_custom_header' ) ) {
// This is all for compatibility with versions of WordPress prior to 3.4.
define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] );
}
/** /**
* Desabilita o FTP na instalação de Plugins * Desabilita o FTP na instalação de Plugins
*/ */