tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support('title-tag');
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support('post-thumbnails');
/**
* Post thumbnail support
*/
add_theme_support('post-thumbnails', array('post', 'gallery_post'));
/**
* Widgets support
*/
add_theme_support('customize-selective-refresh-widgets');
/**
* Post format support
*/
add_theme_support('post-formats', array('image', 'gallery', 'video', 'link', 'quote'));
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menu('custom_menu', __('Main Menu', 'andrina-lite'));
// Define and register starter content to showcase the theme on new sites.
// $starter_content = apply_filters('hustler_starter_content', $starter_content);
add_theme_support('starter-content', array(
// Set up nav menus for the theme.
'nav_menus' => array(
// Assign a menu to the "menu-1" location.
'custom_menu' => array(
'name' => __('Top Menu', 'andrina-lite'),
'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
),
),
),
'widgets' => array(
// Place three core-defined widgets in the sidebar area.
'primary-widget-area' => array(
'search',
'categories',
'recent-posts',
),
'footer-widget-area1' => array(
'my_html1' => array(
// Widget $id -> set when creating a Widget Class
'custom_html',
// Widget $instance -> settings
array(
// 'title' => __( 'Contact', 'andrina-lite' ),
'content' => '
) . '/assets/images/andrina-ft-logo.png)
',
),
),
'my_html2' => array(
// Widget $id -> set when creating a Widget Class
'custom_html',
// Widget $instance -> settings
array(
// 'title' => 'Widget Area',
'content' => '' . __('Footer is widgetized. To setup the footer, drag the required Widgets in Appearance - Widgets Tab in the First, Second, Third and Fourth Footer Widget Areas.', 'andrina-lite') . '
',
),
),
),
// Add the core-defined business info widget to the footer 1 area.
'footer-widget-area2' => array(
'my_html4' => array(
// Widget $id -> set when creating a Widget Class
'custom_html',
// Widget $instance -> settings
array(
'title' => 'Categories',
'content' => join('', array(
""
)),
),
),
),
// Put two core-defined widgets in the footer 2 area.
'footer-widget-area3' => array(
'my_html5' => array(
// Widget $id -> set when creating a Widget Class
'custom_html',
// Widget $instance -> settings
array(
'title' => __('Fully Responsive', 'andrina-lite'),
'content' => '' . __("Andrina is a unique responsive WordPress theme. The theme design is fabulous enough giving your visitors the absolute reason to stay on your site.", "andrina-lite") . '
',
),
),
),
'footer-widget-area4' => array(
'my_html6' => array(
// Widget $id -> set when creating a Widget Class
'custom_html',
// Widget $instance -> settings
array(
'title' => __('Contact Us', 'andrina-lite'),
'content' => join('', array(
""
. '' . __('+1-415-479-4125 or +1-224-280-4110', 'andrina-lite') . ''
. '' . __('3529 Harley Brook Lane Saxton, PA', 'andrina-lite') . ''
. '' . __('MichaelGKnight@teleworm.us', 'andrina-lite') . ''
. "
"
)),
),
),
),
),
)
);
}
endif;
add_action('after_setup_theme', 'andrina_setup');
/**
* Styles Enqueue
* */
function andrina_add_stylesheet() {
/*
* recent-post-widget
*/
// wp_enqueue_style('andrina-recent-post-widget', ANDRINA_DIR_URI . 'includes/widgets/recent-post-widget/css/recent-post-widget.css');
/*
* Font Awesome
*/
wp_enqueue_style('andrina-font_awesome', ANDRINA_DIR_URI . 'assets/css/font-awesome.min.css');
/**
* Bootstrap Stylesheet
*/
wp_enqueue_style('andrina-bootstrap', ANDRINA_DIR_URI . 'assets/css/bootstrap.css');
/**
* Animate Stylesheet
*/
wp_enqueue_style('andrina-animate', ANDRINA_DIR_URI . 'assets/css/animate.css');
/**
* Stylesheet to reset the previous styles.
*/
wp_enqueue_style('andrina-reset', ANDRINA_DIR_URI . 'assets/css/reset.css');
/**
* Font Awesome CSS file
*/
wp_enqueue_style('andrina-font-awesome', ANDRINA_DIR_URI . 'assets/css/font-awesome.css');
/**
* Javascript file for customizer.js
*/
wp_enqueue_script('appointway-ddsmoothmenu', ANDRINA_DIR_URI . 'assets/js/customizer.js', array('jquery'));
/**
* Main Stylesheet - Style.css
*/
wp_enqueue_style('andrina-style', get_stylesheet_uri());
/**
* Raleway Font Family
*/
wp_enqueue_style('andrina-Montserrat-font', '//fonts.googleapis.com/css?family=Montserrat:200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800');
/**
* Open Sans Font Family
*/
wp_enqueue_style('andrina-opensans-font', '//fonts.googleapis.com/css?family=Open+Sans:400,300,500,600,700,800');
/**
* Stylesheet of Mean Menu(Mobile Menu)
*/
wp_enqueue_style('andrina-meanmenu', ANDRINA_DIR_URI . 'assets/css/meanmenu.css');
/**
* Stylesheet of Zoombox
*/
wp_enqueue_style('andrina-zoombox', ANDRINA_DIR_URI . 'assets/css/zoombox.css');
/**
* Stylesheet of Flexslider
*/
wp_enqueue_style('andrina-flexslider', ANDRINA_DIR_URI . 'assets/css/flexslider.css');
/*
* Owl Transitions
*/
wp_enqueue_style('slice-owl-transitions', ANDRINA_DIR_URI . 'assets/css/owl.transitions.css');
/**
* File containing CSS for homepage animation
*/
wp_enqueue_style('slice-hp-animation', ANDRINA_DIR_URI . 'assets/css/andrina_hp_section_animation.css');
/**
* Fontello Icons
*/
wp_enqueue_style('fontello', ANDRINA_DIR_URI . 'assets/css/fontello.css');
/**
* Media Query Stylesheet
*/
wp_enqueue_style('andrina-responsive', ANDRINA_DIR_URI . "assets/css/responsive.css", '', '', 'all');
/**
* Font Awesome Library For Icons
*/
wp_enqueue_style('andrina-fontawesome', ANDRINA_DIR_URI . "assets/font-awesome/css/font-awesome.css", '', '', 'all');
/**
* Font Awesome Library For WooCommerce
*/
wp_enqueue_style('andrina-woocommerce', ANDRINA_DIR_URI . "assets/css/woocommerce.css", '', '', 'all');
}
add_action('wp_enqueue_scripts', 'andrina_add_stylesheet');
/**
* Enqueue script for custom customize control.
*/
function theme_slug_custom_customize_enqueue() {
wp_enqueue_style('customizer-css', ANDRINA_DIR_URI . 'assets/css/customizer.css');
}
add_action('customize_controls_enqueue_scripts', 'theme_slug_custom_customize_enqueue');
/**
* jQuery Enqueue
* */
function andrina_wp_enqueue_scripts() {
if (!is_admin()) {
/**
* DDSmooth Menu (Navigation Menu) JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-ddsmoothmenu', ANDRINA_DIR_URI . 'assets/js/ddsmoothmenu.js', array('jquery'));
/**
* Tabbed Content JS File
* Dependency : jQuery
*/
// wp_enqueue_script('andrina-slides', ANDRINA_DIR_URI . 'assets/js/slides.min.jquery.js', array('jquery'));
wp_enqueue_script('slice-viewportchecker-js', ANDRINA_DIR_URI . 'assets/js/jquery.viewportchecker.js', array('jquery'), '', true);
/**
* Mean Menu JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-meanmenu_js', ANDRINA_DIR_URI . 'assets/js/jquery.meanmenu.js', array('jquery'));
/**
* Zoom Box JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-flexslider', ANDRINA_DIR_URI . 'assets/js/jquery.flexslider.js', array('jquery'));
/**
* Zoom Box JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-zoombox', ANDRINA_DIR_URI . 'assets/js/zoombox.js', array('jquery'));
/**
* customizer preview
* Dependency : jQuery
*/
//wp_enqueue_script('andrina-preview', ANDRINA_DIR_URI . 'assets/js/customize-preview.js', array('jquery'));
/**
* jQuery Validate JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-validate', ANDRINA_DIR_URI . 'assets/js/jquery.validate.min.js', array('jquery'));
/*
* masonry jquery
*/
wp_enqueue_script('andrina-masonry', ANDRINA_DIR_URI . 'assets/js/masonry.pkgd.min.js', array('jquery'));
/**
* Custom JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-custom', ANDRINA_DIR_URI . 'assets/js/custom.js', array('jquery'));
/**
* Captcha JS File
* Dependency : jQuery
*/
wp_enqueue_script('andrina-recaptcha', 'https://www.google.com/recaptcha/api.js', array('jquery'), true);
/**
* Comment Reply JS File
*
*/
if (is_singular() and get_site_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
}
add_action('wp_enqueue_scripts', 'andrina_wp_enqueue_scripts');
//get the theme option from options array
function andrina_get_option($name, $default = '') {
// echo $default;
$options = get_option('andrina_options');
if (isset($options[$name]) && $options[$name] != '') {
return $options[$name];
}
}
// Save all option in single array
function andrina_save_option($option) {
if (!empty($option)) {
return update_option('andrina_options', $option);
}
}
//update theme option
function andrina_update_option($name, $value) {
$options = get_option('andrina_options');
$options[$name] = $value;
return update_option('andrina_options', $options);
}
//delete theme option
function andrina_delete_option($name) {
$options = get_option('andrina_options');
unset($options[$name]);
return update_option('andrina_options', $options);
}
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string The filtered title.
*/
function wpdocs_theme_name_wp_title($title, $sep) {
if (is_feed()) {
return $title;
}
// global $page, $paged;
// Add the blog name
$title .= get_bloginfo('name', 'andrina-display');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'andrina-display');
if ($site_description && ( is_home() || is_front_page() )) {
$title .= " $sep $site_description";
}
return $title;
}
add_filter('wp_title', 'wpdocs_theme_name_wp_title', 10, 2);
/**
* Custom Menus Function
* */
// Add CLASS attributes to the first occurence in wp_page_menu
function andrina_add_menuclass($ulclass) {
return preg_replace('/