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');
// This theme uses wp_nav_menu() in one location.
register_nav_menus(array(
'menu-1' => esc_html__('Primary', 'brikshya-portfolio'),
));
/*
* 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',
));
// Set up the WordPress core custom background feature.
add_theme_support('custom-background', apply_filters('brikshya_theme_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
)));
// Add theme support for selective refresh for widgets.
add_theme_support('customize-selective-refresh-widgets');
}
endif;
add_action('after_setup_theme', 'brikshya_portfolio_theme_setup');
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
if (!function_exists('brikshya_portffolio_custom_logo_setup')) :
function brikshya_portffolio_custom_logo_setup()
{
$defaults = array(
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array('site-title', 'site-description'),
);
add_theme_support('custom-logo', $defaults);
}
endif;
add_action('after_setup_theme', 'brikshya_portffolio_custom_logo_setup');
/**
* register sidebar
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/
*/
if (!function_exists('brikshya_portfolio_sidebar_init')) :
function brikshya_portfolio_sidebar_init() {
register_sidebar( array(
'name' => __( 'Primary Sidebar', 'brikshya-portfolio' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
}
endif;
add_action('widgets_init','brikshya_portfolio_sidebar_init');
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
if (!function_exists('brikshya_portfolio_content_width')) :
function brikshya_portfolio_content_width()
{
$GLOBALS['content_width'] = apply_filters('brikshya_portfolio_content_width', 640);
}
endif;
add_action('after_setup_theme', 'brikshya_portfolio_content_width', 0);
if (!function_exists('brikshya_portfolio_css_scripts')) :
function brikshya_portfolio_css_scripts()
{
// get the theme directory style.css and link to it in the header
wp_enqueue_style('bootstrap.min.css', get_template_directory_uri() . '/assets/css/bootstrap.min.css');
wp_enqueue_style('custom.css', get_template_directory_uri() . '/assets/css/custom.css');
wp_enqueue_style('style.css', get_template_directory_uri() . '/style.css');
wp_enqueue_style('animate.css', get_template_directory_uri() . '/assets/css/animate.css');
wp_enqueue_script('jquery.min.js', get_template_directory_uri() . '/assets/js/jquery.min.js', array(), 1.0, true);
wp_enqueue_script('bootstrap.min.js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), 1.0, true);
wp_enqueue_script('wow.min.js', get_template_directory_uri() . '/assets/js/wow.min.js', array(), 1.0, true);
wp_enqueue_script('isotope.pkgd.min.js', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array(), 1.0, true);
wp_enqueue_script('jquery.matchHeight.js', get_template_directory_uri() . '/assets/js/jquery.matchHeight.js', array(), 1.0, true);
wp_enqueue_script('js/main.js', get_template_directory_uri() . '/assets/js/main.js', array(), 1.0, true);
}
endif;
add_action('wp_enqueue_scripts', 'brikshya_portfolio_css_scripts'); // Register this fxn and allow WordPress to call it automatcally in the header
/**
* Enqueue classic editor styles.
*/
if (!function_exists('brikshya_portfolio_custom_editor_styles')) :
function brikshya_portfolio_custom_editor_styles() {
$classic_editor_styles = array(
'/assets/css/custom.css',
);
add_editor_style( $classic_editor_styles );
}
endif;
add_action( 'init', 'brikshya_portfolio_custom_editor_styles' );
/**
*
* Codestar Framework
* A Custom function for get an option
*
*/
if (!function_exists('prefix_get_option')) {
function prefix_get_option($option = '', $default = null)
{
$options = get_option('theme_options');
return (isset($options[$option])) ? $options[$option] : $default;
}
}
/**
*
* A Custom function for Adding class to A element of .menu-1
*
*/
if (!function_exists('brikshya_portfolio_menu1_anchor_class')) :
function brikshya_portfolio_menu1_anchor_class($item_output, $item, $depth, $args)
{
$item_output = preg_replace('/ $item) {
$objects[$key]->classes[] = 'nav-item';
}
return $objects;
}
endif;
add_filter('wp_nav_menu_objects', 'brikshya_portfolio_menu1_li_class', 10, 2);
if (!function_exists('brikshya_portfolio_menu1_active_elements')) :
function brikshya_portfolio_menu1_active_elements ($classes, $item) {
if (in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
endif;
add_filter('nav_menu_css_class' , 'brikshya_portfolio_menu1_active_elements' , 10 , 2);
/**
* REQUIRED FILES
* Include required files.
* Implement the Custom functions and menu.
*/
require_once get_template_directory() . '/assets/theme-function/codestar-functions.php';
require_once get_template_directory() . '/assets/theme-function/functions.php';
require_once get_template_directory() . '/assets/theme-function/metabox.php';
require_once get_template_directory() . '/inc/activation.php';