' . __( 'Direct script access denied.', 'articled') . '' ); } // Const for Getting current file name define('ARTICLED_CURRENT_FILE', false); defined( 'ARTICLED_DIR' ) or define( 'ARTICLED_DIR', get_template_directory() ); defined( 'ARTICLED_DEVMODE' ) or define( 'ARTICLED_DEVMODE', false ); if( ! function_exists('articled_get_min') ) { function articled_get_min( $t = 'css' ) { if( ! ARTICLED_DEVMODE ) { return '.min.' . $t; } return '.' . $t; } } // Articled theme setup function after_articled_setup() { // Articled supports $_logo_defaults = array( 'height' => 150, 'width' => 200, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $_logo_defaults ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'title-tag' ); // Enable support for title tags. add_theme_support( 'post-thumbnails' ); // Enable support for post thumbnails and featured images. add_theme_support( 'post-formats', array( 'status', 'quote', 'gallery', // Enable support for the following post formats: 'image' , 'video', 'audio', // aside, gallery, quote, image, and video 'link' , 'aside', 'chat' ) ); add_theme_support( 'html5', array( 'comment-list', 'commwwent-form', 'gallery', 'caption' ) ); add_theme_support( 'automatic-feed-links' ); add_editor_style( 'editor-style.css' ); // this is for Masonry post add_image_size('articled_masonry_thumbnail', 455, 310, true); add_image_size( 'articled_60x60', 60, 60, true ); // Articled main thumbnail add_image_size('articled_full_thumbnail', 900, 420, true); // Articled list blog post's thumbnail add_image_size('articled_list_thumbnail', 250, 250, false); add_image_size('articled_list_thumbnail_srcset', 50, 50, false); // low thumbnail for lazy load add_image_size( 'articled_thumbnail_very_low', 44, 22, false ); // Related post's thumbnail for single post add_image_size( 'articled_related-thumbnail', 280, 193, array( 'center', 'center' ) ); add_image_size( 'articled_related_thumbnail_srcset', 100, 65, false ); // lazy load thumbnail add_image_size('articled_data_src_small', 350, 165, false); add_image_size('articled_data_src_medium', 445, 225, false); add_image_size('articled_data_src_large', 625, 293, false); // Setting up default layout if( get_theme_mod('articled_blog_post_layout', 0) == 0 ){ set_theme_mod( 'articled_blog_post_layout' , 2 ); } } add_action( 'after_setup_theme', 'after_articled_setup' ); // articled wp website contents width if( !isset($content_width) ) { $content_width = 900; } // Enqueues every themes css file if( ! function_exists('articled_enqueue_style') ) { function articled_enqueue_style() { wp_enqueue_style( 'articled-google-font', '//fonts.googleapis.com/css?family=' . implode( '|', articled_google_fonts() ), array(), '1.1.2', 'all'); wp_enqueue_style('bootstrap-grid', get_template_directory_uri() . '/inc/third_party/bootstrap/bootstrap-grid' . articled_get_min(), '', '4.0.0', 'all'); wp_enqueue_style('bootstrap-reboot', get_template_directory_uri() . '/inc/third_party/bootstrap/bootstrap-reboot' . articled_get_min(), '', '4.0.0', 'all'); wp_enqueue_style('fontawesome', get_template_directory_uri() . '/inc/third_party/fontawesome/css/all' . articled_get_min(), '', '5.6.0', 'all'); wp_enqueue_style('font-LORA', '//fonts.googleapis.com/css?family=Lora', array(), '1.1.2', 'all'); wp_enqueue_style('main-style', get_stylesheet_uri(), array(), time() , 'all'); wp_enqueue_style('articled-animation-style', get_template_directory_uri() . '/assets/css/articled-animation' . articled_get_min(), '', '1.1.2', 'all'); wp_enqueue_style('articled-mobile', get_template_directory_uri() . '/assets/css/responsive' . articled_get_min(), '', '1.1.2', 'all'); } add_action('wp_enqueue_scripts', 'articled_enqueue_style'); } // Enqueues every themes js file if( ! function_exists('articled_enqueue_sripts') ) { function articled_enqueue_sripts() { wp_enqueue_script('jquery'); wp_enqueue_script('lazy-loading', get_template_directory_uri() . '/assets/js/lazyload' . articled_get_min('js'), array(), '1.8.2', false); wp_enqueue_script('main-js', get_template_directory_uri() . '/assets/js/main-js.js', array(), '1.1.2', false ); wp_enqueue_script('articled-animations-js', get_template_directory_uri() . '/assets/js/articled-animations' . articled_get_min('js'), array('jquery'), '1.1.2', true); } add_action('wp_enqueue_scripts', 'articled_enqueue_sripts'); } // Enable widgetable sidebar // You might need to tweak theme files, more info here - http://codex.wordpress.org/Widgetizing_Themes if( ! function_exists('articled_side_bar_widgets') ) { function articled_side_bar_widgets() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'articled' ), 'id' => 'articled-main-sidebar', 'description' => __( 'Widgets Appear in Sidebar.', 'articled' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar(array( 'name' => __('Slider', 'articled'), 'id' => 'articled-slider-sidebar', 'description' => __( 'You can add widget for displaying on slider.', 'articled' ), 'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('404 Sidebar', 'articled'), 'id' => 'articled-sidebar-404', 'description' => __('Add widgets to 404 Error Page.' , 'articled'), 'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widgets 1', 'articled'), 'id' => 'articled-footer-1', 'description' => '', 'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widgets 2', 'articled'), 'id' => 'articled-footer-2', 'description' => '', 'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'articled_side_bar_widgets' ); } $articled_font_size = array('12px' => '12px','13px' => '13px','14px' => '14px','15px' => '15px','16px' => '16px', '17px' => '17px','18px' => '18px','19px' => '19px','20px' => '20px',) ; // Include Some PHP files require_once ARTICLED_DIR . '/inc/functions/short-functions.php'; require_once ARTICLED_DIR . '/inc/functions/long-functions.php'; require_once get_template_directory() . '/inc/conditional-files.php'; require_once get_template_directory() . '/inc/comment-options.php'; // Include Some Customizer PHP files require_once get_template_directory() . '/inc/options/class-articled-sections.php'; require_once get_template_directory() . '/inc/options/theme-options.php'; require_once get_template_directory() . '/inc/options/class-articled-sanitize.php'; require_once get_template_directory() . '/inc/options/blog/class-articled-blog.php'; require_once get_template_directory() . '/inc/options/topbar/class-articled-top-bar.php'; require_once get_template_directory() . '/inc/options/footer/class-articled-footer.php'; require_once get_template_directory() . '/inc/options/class-articled-partials.php'; require_once get_template_directory() . '/inc/options/class-articled-controls.php'; require_once get_template_directory() . '/inc/options/class-articled-onoffs.php'; require_once get_template_directory() . '/inc/options/class-articled-selects.php'; require_once get_template_directory() . '/inc/options/class-articled-fields.php'; require_once get_template_directory() . '/inc/options/class-articled-headings.php'; require_once get_template_directory() . '/inc/options/class-articled-ranges.php'; require_once get_template_directory() . '/inc/classes/articled.class.php'; foreach ( glob( get_template_directory() . '/inc/classes/*.php', GLOB_NOSORT ) as $key => $value) { require_once wp_normalize_path( $value ); } // Creating Notice for after activating theme $notice_text = '
' . esc_html__( 'Thanks for using "Articled" WordPress Theme.', 'articled' ) . esc_html__( 'If, You\'ve any question. So, Please let me know.', 'articled' ) . '


'; $notice_text .= '' . sprintf( __( '"Articled Booster" plugin is recommended by Author to add more powerfull feature in theme.', 'articled' ), esc_url( 'http://www.abusufiyan.com/plugin/articled-booster?muftki=ha' ) ) . ''; articledNotice::create( $notice_text, true, 'boosterrecommendation' ); // Register Navigations function articled_register_menus () { register_nav_menus( array( 'top-menu' => __( 'Top Bar Menus', 'articled'), 'main-menu' => __( 'Main Menus', 'articled') )); }; add_action('init', 'articled_register_menus'); // enqueue files to customizer if( ! function_exists('articled_customize_enqueues') ) { function articled_customize_enqueues() { wp_enqueue_script( 'jquery-ui-sortable' ); wp_enqueue_script('jQuery-chosen-js', get_template_directory_uri() . '/inc/third_party/chosen/chosen.jquery.js', array( 'jquery'), '1.8.7'); wp_enqueue_style( 'jQuery-chosen-css', get_template_directory_uri() . '/inc/third_party/chosen/chosen.css', null, '1.8.7'); wp_enqueue_style( 'articled-customizer-css', get_template_directory_uri() . '/assets/css/customizer-css.css', null, '1.0', 'all' ); wp_enqueue_script('articled-customizer-js', get_template_directory_uri() . '/assets/js/customizer.js', array( 'jquery', 'jquery-ui-sortable', 'customize-controls' ), '1.0'); } add_action( 'customize_controls_enqueue_scripts', 'articled_customize_enqueues' ); } // oupting user custom css inside head function articled_theme_customize_css_output() { function articled_theme_customize_css(){ $articled_mod = 'get_theme_mod'; require_once( get_template_directory() . '/assets/css/style-customizer.php' ); } echo str_replace(' ', '', articled_theme_customize_css() ); } add_action( 'wp_head' , 'articled_theme_customize_css_output' ); // oupting user custom js inside head function articled_theme_customize_js_output() { require_once( get_template_directory() . '/assets/js/script-customizer.php' ); } add_action( 'wp_footer' , 'articled_theme_customize_js_output' ); /** * Replaces "[...]" (appended to automatically generated excerpts) with ... and * a 'Continue reading' link. * * @since Articled 1.0 * * @param string $link Link to single post/page. * @return string 'Continue reading' link prepended with an ellipsis. */ if( ! function_exists('articled_excerpt_more') ) { function articled_excerpt_more( $excerpt_text ) { if ( is_admin() ) { return; } $excerpt_append = get_theme_mod( 'articled_excerpt_more_text' ); $excerpt_append = $excerpt_append ? $excerpt_append : '[...]'; $excerpt_text = sprintf( '%2$s', esc_url( get_permalink( get_the_ID() ) ), $excerpt_append ); return $excerpt_text; } add_filter( 'excerpt_more', 'articled_excerpt_more'); } if( ! function_exists('articled_excerpt_length') ) { function articled_excerpt_length( $length ) { $length = get_theme_mod('articled_excerpt_more_length'); return ( $length ? $length : 50 ); } add_filter( 'excerpt_length', 'articled_excerpt_length', 999 ); }