__( 'Top Menu', 'magbook' ),
'primary' => __( 'Main Menu', 'magbook' ),
'side-nav-menu' => __( 'Side Menu', 'magbook' ),
'footermenu' => __( 'Footer Menu', 'magbook' ),
'social-link' => __( 'Add Social Icons Only', 'magbook' ),
) );
/*
* Enable support for custom logo.
*
*/
add_theme_support( 'custom-logo', array(
'flex-width' => true,
'flex-height' => true,
) );
add_theme_support( 'gutenberg', array(
'colors' => array(
'#0c4cba',
),
) );
add_theme_support( 'align-wide' );
//Indicate widget sidebars can use selective refresh in the Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* Switch default core markup for comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-form', 'comment-list', 'gallery', 'caption',
) );
/**
* Add support for the Aside Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio', 'chat' ) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'magbook_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
add_editor_style( array( 'css/editor-style.css') );
/**
* Load WooCommerce compatibility files.
*/
require get_template_directory() . '/woocommerce/functions.php';
}
endif; // magbook_setup
add_action( 'after_setup_theme', 'magbook_setup' );
/***************************************************************************************/
function magbook_content_width() {
if ( is_page_template( 'page-templates/gallery-template.php' ) || is_attachment() ) {
global $content_width;
$content_width = 1170;
}
}
add_action( 'template_redirect', 'magbook_content_width' );
/***************************************************************************************/
if(!function_exists('magbook_get_theme_options')):
function magbook_get_theme_options() {
return wp_parse_args( get_option( 'magbook_theme_options', array() ), magbook_get_option_defaults_values() );
}
endif;
/***************************************************************************************/
require get_template_directory() . '/inc/customizer/magbook-default-values.php';
require get_template_directory() . '/inc/settings/magbook-functions.php';
require get_template_directory() . '/inc/settings/magbook-common-functions.php';
require get_template_directory() . '/inc/jetpack.php';
/************************ Magbook Sidebar/ Widgets *****************************/
require get_template_directory() . '/inc/widgets/widgets-functions/register-widgets.php';
require get_template_directory() . '/inc/widgets/widgets-functions/category-box-widget.php';
require get_template_directory() . '/inc/widgets/widgets-functions/category-box-two-layout-widget.php';
require get_template_directory() . '/inc/widgets/widgets-functions/popular-tags-comments.php';
/************************ Magbook Customizer *****************************/
require get_template_directory() . '/inc/customizer/functions/sanitize-functions.php';
require get_template_directory() . '/inc/customizer/functions/register-panel.php';
function magbook_customize_register( $wp_customize ) {
if(!class_exists('Magbook_Plus_Features')){
class Magbook_Customize_upgrade extends WP_Customize_Control {
public function render_content() { ?>
add_section('magbook_upgrade_links', array(
'title' => __('Important Links', 'magbook'),
'priority' => 1000,
));
$wp_customize->add_setting( 'magbook_upgrade_links', array(
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'wp_filter_nohtml_kses',
));
$wp_customize->add_control(
new Magbook_Customize_upgrade(
$wp_customize,
'magbook_upgrade_links',
array(
'section' => 'magbook_upgrade_links',
'settings' => 'magbook_upgrade_links',
)
)
);
}
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title a',
'container_inclusive' => false,
'render_callback' => 'magbook_customize_partial_blogname',
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'container_inclusive' => false,
'render_callback' => 'magbook_customize_partial_blogdescription',
) );
}
require get_template_directory() . '/inc/customizer/functions/design-options.php';
require get_template_directory() . '/inc/customizer/functions/theme-options.php';
require get_template_directory() . '/inc/customizer/functions/color-options.php' ;
require get_template_directory() . '/inc/customizer/functions/featured-content-customizer.php' ;
require get_template_directory() . '/inc/customizer/functions/frontpage-features.php' ;
}
if(!class_exists('Magbook_Plus_Features')){
// Add Upgrade to Plus Button.
require_once( trailingslashit( get_template_directory() ) . 'inc/upgrade-plus/class-customize.php' );
}
/* Color Styles */
require get_template_directory() . '/inc/settings/color-option-functions.php';
/**
* Render the site title for the selective refresh partial.
* @see magbook_customize_register()
* @return void
*/
function magbook_customize_partial_blogname() {
bloginfo( 'name' );
}
/**
* Render the site tagline for the selective refresh partial.
* @see magbook_customize_register()
* @return void
*/
function magbook_customize_partial_blogdescription() {
bloginfo( 'description' );
}
add_action( 'customize_register', 'magbook_customize_register' );
/******************* Magbook Header Display *************************/
function magbook_header_display(){
$magbook_settings = magbook_get_theme_options();
$magbook_header_display = $magbook_settings['magbook_header_display'];
echo '