__('Main Menu', 'nothing-personal'),
'np-mobile-menu' => __('Mobile Menu', 'nothing-personal'),
)
);
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
add_theme_support('custom-background', apply_filters('nothing_personal_custombg_args', array(
'default-color' => 'ffffff',
'default-image' => '',
)));
add_theme_support('customize-selective-refresh-widgets');
add_theme_support('custom-header', array(
'flex-width' => true,
'flex-height' => true,
'height' => 580,
'width' => 1180,
));
add_theme_support('custom-logo', array(
'height' => 58,
'width' => 170,
'flex-width' => true,
'flex-height' => true,
));
}
endif;
add_action('after_setup_theme', 'nothing_personal_setup');
if ( ! function_exists( 'nothing_personal_custombg_args' ) ):
function nothing_personal_custombg_args() {
$background = set_url_scheme( get_background_image() );
$color = get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) );
if ( ! $background && ! $color ) {
return;
}
$style = $color ? "background-color: #$color;" : '';
if ( $background ) {
$image = " background-image: url('$background');";
$repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) {
$repeat = 'repeat';
}
$repeat = " background-repeat: $repeat;";
$position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) {
$position = 'left';
}
$position = " background-position: top $position;";
$attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) {
$attachment = 'scroll';
}
$attachment = " background-attachment: $attachment;";
$style .= $image . $repeat . $position . $attachment;
}
?>
esc_html__('Main Sidebar', 'nothing-personal'),
'id' => 'sidebar',
'description' => esc_html__('This is the default sidebar.', 'nothing-personal'),
'before_widget' => '',
'before_title' => '
',
));
register_sidebar(array(
'name' => esc_html__('Footer 1', 'nothing-personal'),
'id' => 'footer-1',
'description' => esc_html__('Footer sidebar the first from the left.', 'nothing-personal'),
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => esc_html__('Footer 2', 'nothing-personal'),
'id' => 'footer-2',
'description' => esc_html__('Footer sidebar,the second from the left.', 'nothing-personal'),
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => esc_html__('Footer 3', 'nothing-personal'),
'id' => 'footer-3',
'description' => esc_html__('Footer sidebar,the second from the right.', 'nothing-personal'),
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => esc_html__('Footer 4', 'nothing-personal'),
'id' => 'footer-4',
'description' => esc_html__('Footer sidebar,the first from the right.', 'nothing-personal'),
'before_widget' => '',
'before_title' => '',
));
}
add_action('widgets_init', 'nothing_personal_widgets');
function nothing_personal_enqueue_styles()
{
/*
* Function that enqueues the stylesheets
*
* @package Nothing-Personal
* @since 1.0.0
*/
wp_enqueue_style('lato-font', THEMEFONTS . 'Lato/lato-font.min.css', '', '1.0.0', 'all');
wp_enqueue_style('montserrat-font', THEMEFONTS . 'Montserrat/montserrat-font.min.css', '', '1.0.0', 'all');
wp_enqueue_style('playfair-display-font', THEMEFONTS . 'PlayFair-Display/playfair-font.min.css', '', '1.0.0', 'all');
wp_enqueue_style('jam-fonts', THEMEFONTS . 'JamIcons/jam.min.css', '', '1.0.0', 'all');
/*= Vendors =*/
wp_enqueue_style('slick', VENDORASSETS . 'slick/slick-bundle.min.css', '', '1.0.0', 'all');
wp_enqueue_style('fancybox', VENDORASSETS . 'fancybox/jquery.fancybox.min.css', '', '1.0.0', 'all');
wp_enqueue_style('hc-offcanvas-nav', VENDORASSETS . 'hc-nav/hc-offcanvas-nav.min.css', '', '1.0.0', 'all');
wp_enqueue_style('nothing-personal-grid', THEMEASSETS . '/css/flexbox-grid.min.css', '', '1.0.0', 'all');
wp_enqueue_style('nothing-personal-style', get_template_directory_uri() . '/sass/all.min.css', '', time(), 'all');
wp_enqueue_style('nothing-personal-default', get_stylesheet_uri(), '', '1.0.0', 'all');
}
add_action('wp_enqueue_scripts', 'nothing_personal_enqueue_styles');
function nothing_personal_enqueue_scripts()
{
wp_enqueue_script('slick-carousel', THEMEASSETS . 'vendors/slick/slick.min.js', array('jquery'), '1.0.0', true);
wp_enqueue_script('fancybox', THEMEASSETS . 'vendors/fancybox/jquery.fancybox.js', array('jquery'), '1.0.0', true);
wp_enqueue_script('hc-offcanvas-nav', THEMEASSETS . 'vendors/hc-nav/hc-offcanvas-nav.min.js', array('jquery'), '1.0.0', true);
wp_enqueue_script('np-theme', THEMEASSETS . '/js/np.min.js', array('jquery'), time(), true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'nothing_personal_enqueue_scripts');
if (!function_exists('nothing_personal_enqueue_admin_scripts')):
/**
* Function that enqueues the different styles and scripts
* in the admin area.
*
* @package Nothing_Personal
* @since 1.0.0
*/
function nothing_personal_enqueue_admin_scripts($hook)
{
if ('widgets.php' != $hook) {
return;
}
wp_enqueue_style('nothing-personal-widget-css', ADMINASSETS . 'admin-widgets.min.css', '', time(), 'all');
wp_enqueue_script('nothing-personal-widget-js', ADMINASSETS . 'admin-widgets.min.js', array('jquery'), time(), true);
}
add_action('admin_enqueue_scripts', 'nothing_personal_enqueue_admin_scripts');
endif;
if (!function_exists('nothing_personal_customizer_js')):
function nothing_personal_customizer_js()
{
wp_enqueue_script('nothing-personal-customizer-script', get_template_directory_uri() . '/inc/customizer/assets/js/np-customizer.min.js', array(
'jquery',
'customize-preview'
), rand(8, 888), true);
}
endif;
add_action('customize_preview_init', 'nothing_personal_customizer_js');
if (!function_exists('nothing_personal_comments')):
function nothing_personal_comments($comment, $args, $depth)
{
extract($args, EXTR_SKIP);
if ('article' == $args['style']) {
$tag = 'article';
$add_below = 'comment';
} else {
$tag = 'article';
$add_below = 'comment';
}
?>
<
id="comment-" itemscope itemtype="http://schema.org/Comment">
esc_html__( 'Demo Import', 'nothing-personal' ),
'local_import_file' => trailingslashit( get_template_directory() ) . 'demo_data/nothingpersonal.WordPress.2019-04-01.xml',
'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo_data/akisthemes.com-demos-nothing-personal-theme-demo-widgets.wie',
'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo_data/nothing-personal-export.dat',
'import_notice' => __( 'After importing this data everything will be in place like the demo.', 'nothing-personal' ),
'preview_url' => esc_url( 'https://akisthemes.com/demos/nothing-personal-theme-demo/' ),
)
);
}
add_filter( 'pt-ocdi/import_files', 'nothing_personal_import_demo' );
/*
* Import HomePage, Blog and menus
*/
function nothing_personal_import_pages(){
$main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );
$mobile_menu = get_term_by( 'name', 'Mobile Menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations', array(
'np-main-menu' => $main_menu->term_id,
'np-mobile-menu' => $mobile_menu->term_id,
)
);
}
add_action( 'pt-ocdi/after_import', 'nothing_personal_import_pages' );