tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_theme_support( 'custom-logo' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
load_theme_textdomain('charity-review', get_template_directory() . '/languages/');
add_image_size( 'charity_review_post_size', 800, 500, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Header Menu','charity-review' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'charity_review_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
'default-repeat'=> 'repeat',
) ) );
//Site logo from jetpack
$args = array(
'header-text' => array(
'site-title',
'site-description',
),
'size' => 'medium',
);
add_theme_support( 'site-logo', $args );
}
endif; // charity_review_setup
add_action( 'after_setup_theme', 'charity_review_setup' );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
if (! function_exists('charity_review_widgets_init') ) {
function charity_review_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar','charity-review' ),
'id' => 'sidebar-1',
'description' => __( 'Charity Review Sidebar','charity-review' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer 1','charity-review' ),
'id' => 'footer-1',
'description' => __( 'Footer 1','charity-review' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2','charity-review' ),
'id' => 'footer-2',
'description' => __( 'Footer 2','charity-review' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3','charity-review' ),
'id' => 'footer-3',
'description' => __( 'Footer 3','charity-review' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'charity_review_widgets_init' );
}
if (! function_exists('charity_review_add_editor_styles') ) {
function charity_review_add_editor_styles() {
add_editor_style( 'css/editor-style.css' );
}
add_action( 'admin_init', 'charity_review_add_editor_styles' );
}
if( !function_exists('charity_review_hook_javascript')){
add_action('wp_head','charity_review_hook_javascript');
function charity_review_hook_javascript() {
?>
charity_review_localize_jetpack()
);
wp_localize_script( 'charity-review-functions-js', 'functionLoc', $jetpack_val );
wp_enqueue_script( 'charity-review-vendor-js', get_stylesheet_directory_uri() . '/js/vendor.js');
$color = ( esc_attr( get_theme_mod( 'logo_background_color' ) ) ) ? esc_attr( get_theme_mod( 'logo_background_color' ) ) : '#0072bc';
$hover_color = ( esc_attr( get_theme_mod( 'hover_background_color' ) ) ) ? esc_attr( get_theme_mod( 'hover_background_color' ) ) : '#cb2a2a';
$from_blog_background = ( esc_attr( get_theme_mod('from_the_blog_background') ) ) ? esc_attr( get_theme_mod('from_the_blog_background') ) : '';
$social_media_background = ( esc_attr( get_theme_mod('social_media_background' ) ) ) ? esc_attr( get_theme_mod('social_media_background' ) ) : '';
$maxContainerWidth = '1170';
$bg_color_404 = esc_attr( get_theme_mod('background_color') );
$blog_title_color = esc_attr( get_theme_mod('title_color') );
$width = '';
$site_css_change = ( get_theme_mod( 'css_change' ) ) ? get_theme_mod( 'css_change' ) : '';
if ( get_theme_mod('max_width') != '' ) {
$containerWidth = '100';
$maxContainerWidth = get_theme_mod('max_width');
$width = "width: {$containerWidth}%";
}
$minContainerWidth = '1170';
$min_width = '';
$header_text_color = get_header_textcolor();
$desc_color = $header_text_color;
$custom_css = "
@media (min-width: 1200px){
.container {
max-width: {$maxContainerWidth}px;
".$width."
}
}
.site-branding {
background: none repeat scroll 0% 0% {$color};
box-shadow: 0px -12px 0px 0px {$color};
}
.site-branding::before {
border-left: 12px solid {$color};
}
.image-404{
background-color: #{$bg_color_404} ;
}
.site-title a{ color: {$desc_color} ;}
.navbar .site-branding:hover {
background: none repeat scroll 0% 0% {$hover_color};
box-shadow: 0px -12px 0px 0px {$hover_color};
}
.navbar .site-branding:hover:before {
border-left: 12px solid {$hover_color};
}
.section.blogroll {
background: #f1f1f1 url($from_blog_background) repeat center center fixed;
background-size: cover;
}
.social-section{
background: url($social_media_background) repeat center center fixed #272e37;
}
.section-title{
color: $blog_title_color;
}
$site_css_change
";
wp_add_inline_style( 'charity-review-css', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'charity_review_scripts' );
}
/**
*
* Layout functions
*
**/
if(! function_exists('charity_review_boxedornot')){
function charity_review_boxedornot() {
$boxedornot = 'boxed';
if ( get_theme_mod('layout_control') != '' ) {
$boxedornot = esc_attr( get_theme_mod('layout_control') );
}
return $boxedornot;
}
}
/** }
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
require get_template_directory() . '/inc/custom-header.php';
/**
* Customizer additions.
*/
get_template_part('inc/customizer');
/**
* Breadcrumb Option.
*/
require get_template_directory() . '/inc/custom-breadcrumb.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Bootstrap integration
*/
require get_template_directory() . '/inc/functions-strap.php';
if(! function_exists('charity_review_trim_excerpt')){
function charity_review_trim_excerpt( $text ) {
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters( 'the_content', $text );
$text = str_replace( '\]\]\>', ']]>', $text );
$alllowed_tags = '