add comments in the functions

This commit is contained in:
Fabiano Alencar 2018-04-10 14:10:00 -03:00
parent 28c67e85ad
commit 8375b0e309
1 changed files with 37 additions and 19 deletions

View File

@ -1,8 +1,8 @@
<?php <?php
/** /**
* Setup Theme * Setup Theme
*/ */
if(!function_exists('tainacan_setup')) { if(!function_exists('tainacan_setup')) {
/** /**
@ -10,29 +10,26 @@ if(!function_exists('tainacan_setup')) {
* Isso é usado para a configuração básica do tema, registro dos recursos do tema e init hooks. * Isso é usado para a configuração básica do tema, registro dos recursos do tema e init hooks.
* Observe que esta função está conectada ao gancho after_setup_theme, que é executado antes do gancho de init. * Observe que esta função está conectada ao gancho after_setup_theme, que é executado antes do gancho de init.
*/ */
function tainacan_setup() { function tainacan_setup() {
/**
$custom_header_support = array(// The default header text color. * Display in gutenberg plugin the full width for image
'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'] );
}
add_theme_support( 'align-wide' ); add_theme_support( 'align-wide' );
add_theme_support( 'html5', array( 'comment-list' , 'comment-form') ); add_theme_support( 'html5', array( 'comment-list' , 'comment-form') );
add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-thumbnails' );
/**
* Custom header to change the banner image
*/
$header_args = array( $header_args = array(
'default-text-color' => '000', //'default-text-color' => '000',
'header-text' => true, 'header-text' => false,
'flex-width' => false, 'flex-width' => false,
'flex-height' => true, 'flex-height' => true,
); );
add_theme_support( 'custom-header', $header_args ); add_theme_support( 'custom-header', $header_args );
/* register_default_headers( /* register_default_headers(
array( array(
'default-image' => array( 'default-image' => array(
@ -42,6 +39,10 @@ if(!function_exists('tainacan_setup')) {
), ),
) )
); */ ); */
/**
* Custom logo to change the logo image
*/
$logo_args = array( $logo_args = array(
'height' => 25, 'height' => 25,
'width' => 400, 'width' => 400,
@ -90,6 +91,11 @@ function tainacan_widgets_footer_init() {
} }
add_action( 'widgets_init', 'tainacan_widgets_footer_init' ); add_action( 'widgets_init', 'tainacan_widgets_footer_init' );
/**
* get Logo function
*
* return custom logo or the default logo
*/
function tainacan_get_logo() { function tainacan_get_logo() {
if (has_custom_logo()) { if (has_custom_logo()) {
return get_custom_logo(); return get_custom_logo();
@ -101,6 +107,12 @@ function tainacan_get_logo() {
} }
} }
/**
* Change logo class function
*
* @param [type] $html
* @return void
*/
function tainacan_change_logo_class( $html ) { function tainacan_change_logo_class( $html ) {
$html = str_replace( 'custom-logo-link', 'navbar-brand tainacan-logo', $html ); $html = str_replace( 'custom-logo-link', 'navbar-brand tainacan-logo', $html );
@ -110,13 +122,19 @@ function tainacan_change_logo_class( $html ) {
} }
add_filter( 'get_custom_logo', 'tainacan_change_logo_class' ); add_filter( 'get_custom_logo', 'tainacan_change_logo_class' );
/**
* Class navwalker
*/
require_once get_template_directory() . '/vendor/class-wp-bootstrap-navwalker.php'; require_once get_template_directory() . '/vendor/class-wp-bootstrap-navwalker.php';
/**
* Register the menu for use after the banner
*/
register_nav_menus( array( register_nav_menus( array(
'navMenubelowHeader' => __( 'Nav Menu Below Header', 'tainacan-theme' ), 'navMenubelowHeader' => __( 'Nav Menu Below Header', 'tainacan-theme' ),
) ); ) );
require get_template_directory() . '/functions/enqueues.php'; require get_template_directory() . '/functions/enqueues.php';
require get_template_directory() . '/functions/customize.php'; require get_template_directory() . '/functions/customizer.php';
require get_template_directory() . '/functions/pagination.php'; require get_template_directory() . '/functions/pagination.php';
require get_template_directory() . '/functions/single-functions.php'; require get_template_directory() . '/functions/single-functions.php';