esc_html__( 'Primary Menu', 'manual' ),
) );
$args = array(
'width' => 365,
'height' => 365,
'default-image' => get_template_directory_uri() . '/img/noise.jpg',
'uploads' => true,
);
add_theme_support( 'default-theme-header', $args );
}
}
add_action( 'after_setup_theme', 'manual_theme_manual_setup' );
/*-----------------------------------------------------------------------------------*/
/* Include Theme Options Framework
/*-----------------------------------------------------------------------------------*/
require_once( trailingslashit( get_template_directory() ) . 'framework/ReduxCore/manual/manual.php' );
/*-----------------------------------------------------------------------------------*/
/* IMPORT
/*-----------------------------------------------------------------------------------*/
require trailingslashit( get_template_directory() ) . 'framework/import/one-click-import.php';
/*-----------------------------------------------------------------------------------*/
/* Add Widget Areas
/*-----------------------------------------------------------------------------------*/
function manual_theme_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Primary Area', 'manual' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here to appear in your blog/search/archive area', 'manual' ),
'before_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Faq Widgets', 'manual' ),
'id' => 'faq-1',
'description' => esc_html__( 'Add widgets here to appear inside FAQ page.', 'manual' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Faq Sidebar', 'manual' ),
'id' => 'faq-sidebar-1',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Contact Us Sidebar', 'manual' ),
'id' => 'contact-sidebar-1',
'description' => esc_html__( 'Add widgets here to appear on the Contact Us page sidebar.', 'manual' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Knowledge Base Sidebar', 'manual' ),
'id' => 'kb-sidebar-1',
'description' => esc_html__( 'Add widgets here to appear on the Knowledge Base page sidebar.', 'manual' ),
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Box 1', 'manual' ),
'id' => 'footer-box-1',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Box 2', 'manual' ),
'id' => 'footer-box-2',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Box 3', 'manual' ),
'id' => 'footer-box-3',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Box 4', 'manual' ),
'id' => 'footer-box-4',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'manual_theme_widgets_init' );
/*-----------------------------------------------------------------------------------*/
/* Enqueue scripts and styles.
/*-----------------------------------------------------------------------------------*/
function manual_theme_scripts() {
// Internet Explorer HTML5 support
wp_enqueue_script( 'html5shiv', 'https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js', array(), '3.7.3', false);
wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' );
// Internet Explorer 8 media query support
wp_enqueue_script( 'respond', 'https://oss.maxcdn.com/respond/1.4.2/respond.min.js', array(), '1.4.2', false);
wp_script_add_data( 'respond', 'conditional', 'lt IE 9' );
wp_enqueue_script( 'bootstrap', trailingslashit( get_template_directory_uri() ) . 'js/bootstrap.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'manual-custom-timer', trailingslashit( get_template_directory_uri() ) . 'js/timer.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'manual-custom-appear', trailingslashit( get_template_directory_uri() ) . 'js/appear.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'manual-parallax-min', trailingslashit( get_template_directory_uri() ) . 'js/parallax/parallax.min.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'manual-parallax', trailingslashit( get_template_directory_uri() ) . 'js/parallax/parallax.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'manual-js-owl', trailingslashit( get_template_directory_uri() ) . 'js/owl/owl.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'masonry' );
wp_enqueue_script( 'manual-custom-script', trailingslashit( get_template_directory_uri() ) . 'js/theme.js', array( 'jquery' ), false, true );
// embed the javascript file that makes the AJAX request
wp_enqueue_script( 'manual-ajax-request', plugin_dir_url( __FILE__ ) . 'js/ajax.js', array( 'jquery' ) );
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() ) {
wp_enqueue_script( 'comment-reply' );
}
/*
* Loads our main stylesheet.
*/
wp_enqueue_style( 'fontawesome', trailingslashit(get_template_directory_uri()) . 'css/font-awesome/css/font-awesome.css', array(), '3.3.1' );
wp_enqueue_style( 'et-line-font', trailingslashit(get_template_directory_uri()) . 'css/et-line-font/style.css', array(), '3.3.1' );
wp_enqueue_style( 'manual-style', get_stylesheet_uri() );
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'manual-fonts', manual_fonts_url(), array(), null );
wp_enqueue_style( 'manual-bootstrap', trailingslashit( get_template_directory_uri() ) . 'css/lib/bootstrap.min.css', array(), '3.3.1' );
wp_enqueue_style( 'manual-css-owl', trailingslashit( get_template_directory_uri() ) . 'js/owl/owl.css', array(), '' );
wp_enqueue_style( 'manual-css-owl-theme', trailingslashit( get_template_directory_uri() ) . 'js/owl/owl-theme.css', array(), '' );
wp_enqueue_style( 'manual-effect', trailingslashit( get_template_directory_uri() ) . 'css/hover.css', array(), '' );
}
add_action( 'wp_enqueue_scripts', 'manual_theme_scripts' );
/*-----------------------------------------------------------------------------------*/
/* Font URL
/*-----------------------------------------------------------------------------------*/
function manual_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/* translators: To add an additional Open Sans character subset specific to your language, translate
this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
$subset = _x( 'no-subset', 'PT Sans font: add new subset (greek, cyrillic, vietnamese)', 'manual' );
if ( 'cyrillic' == $subset )
$subsets .= ',cyrillic,cyrillic-ext';
elseif ( 'greek' == $subset )
$subsets .= ',greek,greek-ext';
elseif ( 'vietnamese' == $subset )
$subsets .= ',vietnamese';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = add_query_arg(array(
'family' => 'Source+Sans+Pro:300,400,600,700|Open+Sans:100,200,300,400,600,700,800|Roboto:300,400,500,700|Raleway:100,200,300,400,500,600,700,800,900',
'subset' => $subsets,
), '//fonts.googleapis.com/css');
return $query_args;
}
/*-----------------------------------------------------------------------------------*/
/* ReduxFrameworkPlugin MODIFY
/*-----------------------------------------------------------------------------------*/
function manual_admin_custom_style() {
wp_enqueue_style('manual-admin-styles', trailingslashit(get_template_directory_uri()) . 'css/admin.css', array(), '' );
}
add_action('admin_enqueue_scripts', 'manual_admin_custom_style');
/** REMOVE REDUX MESSAGES */
function manual_remove_redux_messages() {
if(class_exists('ReduxFramework')){
remove_action( 'admin_notices', array( get_redux_instance('redux_demo'), '_admin_notices' ), 99);
}
}
add_action('init', 'manual_remove_redux_messages');
/*-----------------------------------------------------------------------------------*/
/* Custom Menu
/*-----------------------------------------------------------------------------------*/
class manual_menu_walker extends Walker {
var $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent\n";
}
function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "$indent
\n";
}
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
/* Add active class */
if(in_array('current-menu-item', $classes)) {
$classes[] = 'active';
unset($classes['current-menu-item']);
}
/* Check for children */
$children = get_posts(array('post_type' => 'nav_menu_item', 'nopaging' => true, 'numberposts' => 1, 'meta_key' => '_menu_item_menu_item_parent', 'meta_value' => $item->ID));
if (!empty($children)) {
$classes[] = 'has-sub';
}
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$output .= $indent . '';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '';
$item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
function end_el( &$output, $item, $depth = 0, $args = array() ) {
$output .= "\n";
}
}
/*-----------------------------------------------------------------------------------*/
/* Custom Comment Buttom
/*-----------------------------------------------------------------------------------*/
function manual_custom_comment_button() {
echo '';
}
add_action( 'comment_form', 'manual_custom_comment_button' );
/*-----------------------------------------------------------------------------------*/
/* HEX 2 RGB
/*-----------------------------------------------------------------------------------*/
function hex2rgb($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
$b = hexdec(substr($hex,4,2));
}
$rgb = array($r, $g, $b);
return $rgb; // returns an array with the rgb values
}
/*-----------------------------------------------------------------------------------*/
/* Add MetaBox Library
/*-----------------------------------------------------------------------------------*/
require trailingslashit( get_template_directory() ) . 'framework/post-meta/home-pg-block.php';
require trailingslashit( get_template_directory() ) . 'framework/post-meta/pagemeta.php';
/*-----------------------------------------------------------------------------------*/
/* Customizer
/*-----------------------------------------------------------------------------------*/
require trailingslashit( get_template_directory() ) . 'framework/customizer.php';
/**
* Custom template tags for this theme.
*
* @since Twenty Fifteen 1.0
*/
require trailingslashit( get_template_directory() ) . 'framework/template-tags.php';
/**
* Widget Register
*/
require trailingslashit( get_template_directory() ) . 'framework/widget-type.php';
/**
* Widget Register
*/
require trailingslashit( get_template_directory() ) . 'framework/temp-nav.php';
/**
* Plugin Activation
*/
require_once trailingslashit( get_template_directory() ) . 'framework/inc/tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'manual_theme_register_required_plugins' );
function manual_theme_register_required_plugins() {
$theme_url = trailingslashit( get_template_directory() );
$plugins = array(
// Contact Form 7
array(
'name' => 'Contact Form 7', // The plugin name.
'slug' => 'contact-form-7', // The plugin slug (typically the folder name).
'source' => 'https://downloads.wordpress.org/plugin/contact-form-7.4.2.2.zip', // The plugin source.
'required' => true, // If false, the plugin is only 'recommended' instead of required.
'external_url' => 'https://downloads.wordpress.org/plugin/contact-form-7.4.2.2.zip', // If set, overrides default API URL and points to an external URL.
),
// Manual Framework
array(
'name' => 'Manual Framework', // The plugin name.
'slug' => 'manual-framework', // The plugin slug (typically the folder name).
'source' => 'http://demo.wpsmartapps.com/free/manual-framework.zip', // The plugin source.
'required' => true, // If false, the plugin is only 'recommended' instead of required.
'external_url' => 'http://demo.wpsmartapps.com/free/manual-framework.zip', // If set, overrides default API URL and points to an external URL.
),
// Redux Framework
array(
'name' => 'Redux Framework', // The plugin name.
'slug' => 'redux-framework', // The plugin slug (typically the folder name).
'required' => true, // If false, the plugin is only 'recommended' instead of required.
),
// CMB2
array(
'name' => 'CMB2',
'slug' => 'cmb2',
'required' => true,
),
// One Click Demo Import
array(
'name' => 'One Click Demo Import',
'slug' => 'one-click-demo-import',
'required' => false,
),
);
$config = array(
'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'parent_slug' => 'themes.php', // Parent menu slug.
'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
tgmpa( $plugins, $config );
}
function manual_social_share($url){
global $theme_options;
if( isset($theme_options['theme-social-box']) && $theme_options['theme-social-box'] == true ) {
?>