Direct script access denied.' );
}
// Const for Getting current file name
define('ABU_CURRENT_FILE', false);
require_once get_template_directory() . '/inc/functions.php';
// Articled theme setup
function after_articled_setup() {
// Roohani 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( 'custom-background');
add_theme_support( 'custom-header' );
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',
'search-form',
'gallery', 'caption'));
add_theme_support( 'automatic-feed-links' );
add_editor_style( 'editor-style.css' );
add_image_size('articled_masonry_thumbnail', 455, 310, true);
add_image_size( 'articled_60x60', 60, 60, true );
add_image_size('articled_full_thumbnail', 900, 420, true);
add_image_size('articled_list_thumbnail', 250, 250, false);
add_image_size('articled_list_thumbnail_srcset', 50, 50, false);
add_image_size( 'articled_thumbnail_very_low', 44, 22, false );
add_image_size( 'articled_related-thumbnail', 280, 193, array( 'center', 'center' ) );
add_image_size( 'articled_related_thumbnail_srcset', 100, 65, false );
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);
}
add_action( 'after_setup_theme', 'after_articled_setup' );
$default_set_theme_mod = [
"articled_blog_post_layout"=> 2,
"articled_verified" => 1
];
if( get_theme_mod('articled_verified', 0) == 0 ){
foreach ($default_set_theme_mod as $key => $value) {
if( get_theme_mod($key, 0) ) continue;
set_theme_mod($key, $value);
}
}
// 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() {
$user_custom_font = articled_google_fonts();
foreach ($user_custom_font as $key) {
wp_enqueue_style( 'google-font-'.str_replace(':', '-', $key ), '//fonts.googleapis.com/css?family='.$key, array(), '1.0', 'all');
}
wp_enqueue_style('bootstrap-grid', get_template_directory_uri() . '/inc/third_party/bootstrap/bootstrap-grid.css', '', '4.0.1', 'all');
wp_enqueue_style('bootstrap-reboot', get_template_directory_uri() . '/inc/third_party/bootstrap/bootstrap-reboot.css', '', '4.0.1', 'all');
wp_enqueue_style('fontawesome', get_template_directory_uri() . '/inc/third_party/fontawesome/css/all.css', '', '5.6.0', 'all');
wp_enqueue_style('font-LORA', '//fonts.googleapis.com/css?family=Lora', array(), '1.0.1', 'all');
wp_enqueue_style('main-style', get_stylesheet_uri(), array(), time(), 'all');
wp_enqueue_style('animation-style', get_template_directory_uri() . '/assets/css/animation.css', '', '1.0', 'all');
wp_enqueue_style('articled-mobile', get_template_directory_uri() . '/assets/css/responsive.css', '', '1.0', '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.min.js', array(), null, false);
wp_enqueue_script('main-js', get_template_directory_uri() . '/assets/js/main-js.js', array(), '1.0', false );
wp_enqueue_script('animations-js', get_template_directory_uri() . '/assets/js/animations.js', array('jquery'), '1.0', 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' => '',
) );
register_sidebar(array(
'name' => __('Slider', 'articled'),
'id' => 'articled-slider-sidebar',
'description' => 'You can add widget for displaying on slider.',
'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' => '',
));
register_sidebar(array(
'name' => __('Footer Widgets 1', 'articled'),
'id' => 'articled-footer-1',
'description' => '',
'before_widget' => '',
'after_widget' => "
",
'before_title' => '',
));
register_sidebar(array(
'name' => __('Footer Widgets 2', 'articled'),
'id' => 'articled-footer-2',
'description' => '',
'before_widget' => '',
'after_widget' => "
",
'before_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 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';
// 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('customizer-js', get_template_directory_uri() . '/admin/js/customizer-control.js', array( 'jquery', 'jquery-ui-sortable', 'customize-controls' ), '1.0');
}
add_action( 'customize_controls_enqueue_scripts', 'articled_customize_enqueues' );
}
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' );
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_exists('articled_excerpt_length') ){
function articled_excerpt_more( $excerpt_text ) {
if ( is_admin() ) { return; }
if ( get_theme_mod('articled_excerpt_more_text', '[...]') == '[...]' ) {
$excerpt_append = '[...]';
} else {
$excerpt_append = get_theme_mod('articled_excerpt_more_text', '[...]');
}
$excerpt_text = sprintf( '%2$s', esc_url( get_permalink( get_the_ID() ) ), $excerpt_append );
return $excerpt_text;
}
add_filter( 'excerpt_more', 'articled_excerpt_more');
function articled_excerpt_length( $length ) {
if( get_theme_mod('articled_excerpt_more_length', 50) == 50 ){
$length = 50;
} else {
$length = get_theme_mod('articled_excerpt_more_length', 50);
}
return $length;
}
add_filter( 'excerpt_length', 'articled_excerpt_length', 999 );
}