'Instagram Slider Widget', 'slug' => 'instagram-slider-widget', 'required' => false, ), // Facebook Widget array( 'name' => 'Facebook Widget', 'slug' => 'facebook-pagelike-widget', 'required' => false, ), // Contact Form 7 array( 'name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, ), //Lightweight Social Icons array( 'name' => 'Lightweight Social Icons', 'slug' => 'lightweight-social-icons', 'required' => false, ), // Royal Backend Gallery array( 'name' => 'Royal Backend Gallery', 'slug' => 'royal-backend-gallery', 'source' => ADENIT_THEMEROOT . '/plugins/royal-backend-gallery.zip', 'required' => true, 'version' => '1.0', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', ), // Royal Backend Gallery array( 'name' => 'Envato Wordpress Toolkit Master', 'slug' => 'envato-wordpress-toolkit-master', 'source' => ADENIT_THEMEROOT . '/plugins/envato-wordpress-toolkit-master.zip', 'required' => true, 'version' => '1.0', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', ), ); tgmpa( $plugins ); } } add_action( 'tgmpa_register', 'adenit_tgm_activation' ); /** * ---------------------------------------------------------------------------------------- * Set up theme default / supported features * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_setup' ) ) { function adenit_setup() { // Title Support add_theme_support('title-tag'); // Add support for post formats add_theme_support( 'post-formats', array( 'gallery', 'link', 'quote', 'video', 'audio' ) ); // Register nav menus register_nav_menus( array( 'top-menu' => esc_html__( 'Top Menu', 'aden' ), 'main-menu' => esc_html__( 'Main Menu', 'aden' ) ) ); // Content Width if ( ! isset( $content_width ) ) { $content_width = 960; } } add_action( 'after_setup_theme', 'adenit_setup' ); } // Load Language File For Translation load_theme_textdomain( 'aden', ADENIT_THEMEROOT .'/languages' ); // Add support for automatic feed links add_theme_support( 'automatic-feed-links' ); // Add support for post thumbnails add_theme_support( 'post-thumbnails' ); // Image Size add_image_size( 'adenit-post-carousel', 800, 500, true ); add_image_size( 'adenit-post-thumbnail', 825, 550, true ); add_image_size( 'adenit-pagination-thumbnail', 380, 120, true ); add_image_size( 'adenit-search-thumbnail', 250, 190, true ); /** * ---------------------------------------------------------------------------------------- * Register the widgets * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_widget_init' ) ) { function adenit_widget_init() { if ( function_exists( 'register_sidebar' ) ) { register_sidebar( array( 'name' => esc_html__( 'Sidebar Widget Area', 'aden' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Appears on posts and pages.', 'aden' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar( array( 'name' => esc_html__( 'Instagram Widget Area', 'aden' ), 'id' => 'sidebar-2', 'description' => esc_html__( 'Appears on posts and pages.', 'aden' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar( array( 'name' => esc_html__( 'Fixed Sidebar Widget Area', 'aden' ), 'id' => 'sidebar-3', 'description' => esc_html__( 'Appears on posts and pages.', 'aden' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } } add_action( 'widgets_init', 'adenit_widget_init' ); } /** * ---------------------------------------------------------------------------------------- * Custom Excerpt Length * ---------------------------------------------------------------------------------------- */ function adenit_excerpt_length( $length = 50 ) { $post_fullwidth_value = get_post_meta( get_the_ID(), 'post-fullwidth-checkbox', true ); $content_options = get_option( 'adenit_content' ); if ( is_home() ) { if( $post_fullwidth_value ){ return ( 3 * (int)$content_options['post_excerpt_length'] ); } return $content_options['post_excerpt_length']; } if ( is_search() ) { return 60; } return $length; } add_filter( 'excerpt_length', 'adenit_excerpt_length', 999 ); function adenit_new_excerpt( $more ) { return '...'; } add_filter( 'excerpt_more', 'adenit_new_excerpt' ); /** * ---------------------------------------------------------------------------------------- * Adding Post & Page Classes * ---------------------------------------------------------------------------------------- */ function adenit_post_classes( $classes, $class, $post_id ) { if( is_single() ) { $classes[] .= 'adenit-single-post'; } else if ( is_page() ) { $classes[] .= 'adenit-page col-1'; } else { $classes[] .= 'main-post'; } return $classes; } add_filter( 'post_class', 'adenit_post_classes', 10, 3 ); /** * ---------------------------------------------------------------------------------------- * Adding Body Classes * ---------------------------------------------------------------------------------------- */ function adenit_body_classes( $classes ) { $header_options = get_option( 'adenit_header' ); $classes[] = ( $header_options['effect'])?'animsition':''; return $classes; } add_filter( 'body_class','adenit_body_classes' ); /** * ---------------------------------------------------------------------------------------- * Custom Search Form * ---------------------------------------------------------------------------------------- */ function adenit_search_form( $search_value ) { if ( $search_value === 'header' ) { $form = '
'; $form .= '
'; $form .= '
'; $form .= '
'; $form .= ''; $form .= ''; $form .= '
'; $form .= '
'; $form .= '
'; $form .= '
'; } else { $form = ''; } return $form; } add_filter( 'get_search_form', 'adenit_search_form' ); /** * ---------------------------------------------------------------------------------------- * Nav Menu Function * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_nav_menu' ) ) { function adenit_nav_menu( $adenit_nav_class = '', $adenit_theme_location = '', $adenit_depth = 0 ) { if ( has_nav_menu( $adenit_theme_location ) ) { wp_nav_menu( array( 'theme_location' => $adenit_theme_location, 'container' => 'nav', 'container_class' => $adenit_nav_class, 'menu_class' => '', 'depth' => $adenit_depth )); } else { echo ''; } } } /** * ---------------------------------------------------------------------------------------- * Header Bottom Function * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_header_bottom' ) ) { function adenit_header_bottom( $header_bottom_class = 'header-bottom' ) { // Get Option $header_options = get_option( 'adenit_header' ); ?>
max_num_pages; if( !$pages ) { $pages = 1; } } if ( 1 != $pages ) { if ( $paged > 2 && $paged > $range+1 && $showitems < $pages ) { echo ""; } if ( $paged > 1 ) { echo ""; } for ( $i=1; $i <= $pages; $i++ ) { if (1 != $pages &&( !( $i >= $paged+$range+1 || $i <= $paged-$range-1 ) || $pages <= $showitems ) ) { echo ( $paged == $i )? "".$i."":"".$i.""; } } if ( $paged < $pages ) { echo ""; } if ( $paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages ) { echo ""; } } } } /** * ---------------------------------------------------------------------------------------- * Owl Carousel Function * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_carousel' ) ) { function adenit_carousel( $carousel_class = '' ) { if ( is_home() ) { $carousel_options = get_option( 'adenit_carousel' ); $carousel_class .= ( $carousel_options['boxed']) ? 'center-max-width' : ''; ?> '; if ( !is_single() && (false == get_post_format() || $content_options['post_thumbnail']) ) { echo ''; echo ''; } //Get Post Thumbnail if ( $content_options['post_column'] === 'col-1' || is_single() || ( !empty( $post_fullwidth_value ) && is_home() ) ) { the_post_thumbnail('full'); } else { the_post_thumbnail( 'adenit-post-thumbnail' ); } echo ''; } } } /** * ---------------------------------------------------------------------------------------- * Main Post * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_main_post' ) ) { function adenit_main_post() { //Get Options $content_options = get_option( 'adenit_content' ); ?>
' . $category_list . ' '; } // If single page, display the title // Else, we display the title in a link if ( is_single() ) : ?>

%2$s / ', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_the_author() ); } // Post Date if ( $content_options['post_date'] ) { // Get the date echo get_the_time( get_option('date_format') ); } ?>
'', 'link_before' => '', 'link_after' => '', ) ); } if ( $content_options['post_read_more'] && !is_single() ) { echo '
'; echo ''.esc_html__( 'view post','aden' ).''; echo '
'; } ?>

' . $category_list . ' '; } ?>

'', 'link_before' => '', 'link_after' => '', ) ); if ( $content_options['post_read_more'] && !is_single() ) { echo '
'; echo ''.esc_html__( 'view post','aden' ).''; echo '
'; } } ?>
'; if ( trim( $social_options['facebook'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Facebook', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['google_plus'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Google +', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['twitter'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Twitter', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['youtube'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Youtube', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['flickr'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Flickr', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['linkedin'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Linkedin', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['bloglovin'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Bloglovin', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['tumblr'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Tumblr', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['pinterest'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Pinterest', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['behance'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Behance', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['vimeo'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Vimeo', 'aden' ) .''; $html .= ''; } if ( trim( $social_options['instagram'] ) !== '' ) { $html .= ''; $html .= ''; $html .= ''. esc_html__( 'Instagram', 'aden' ) .''; $html .= ''; } $html .= ''; echo '' . $html; } } /** * ---------------------------------------------------------------------------------------- * Breadcrumb Section * ---------------------------------------------------------------------------------------- */ if ( ! function_exists( 'adenit_breadcrumb' ) ) { function adenit_breadcrumb () { // Get Option $content_options = get_option( 'adenit_content' ); if ( $content_options['breadcrumb'] ) { // Settings $separator = '/'; $id = 'adenit-breadcrumbs'; $class = 'adenit-breadcrumbs'; $home_title = esc_html__( 'Home', 'aden' ); $parents = ''; // Get the query & post information global $post,$wp_query; $category = get_the_category(); // Do not display on the homepage if ( !is_front_page() ) { // Build the breadcrums echo '
'; echo '
'; echo ''; echo '
'; echo '
'; } } } } /** * ---------------------------------------------------------------------------------------- * Sharing Functions Section * ---------------------------------------------------------------------------------------- */ // Meta Share tag function el_meta_sharing() { global $post; $my_postid = get_the_ID(); //This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; $content = apply_filters('the_content', $content); $content = strip_tags(str_replace(']]>', ']]>', $content)); $fb_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID()), 'large' ); if ( isset( $fb_image ) ) { echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; echo ''; } add_action( 'wp_head', 'el_meta_sharing' ); if ( ! function_exists( 'adenit_sharing' ) ) { function adenit_sharing() { //Get Options $content_options = get_option( 'adenit_content' ); global $post; // Post share if ( $content_options['facebook_share'] || $content_options['twitter_share'] || $content_options['pinterest_share'] || $content_options['googleplus_share'] || $content_options['linkedin_share'] || $content_options['tumblr_share'] || $content_options['reddit_share'] ) : ?>
ID)) ).'&description='.get_the_title(); ?>
  • >
  • >
    comment_parent != 0 ) { $avatar_size = 55; } echo get_avatar( $comment, $avatar_size ); ?>

    comment_approved == '0') : ?>

    $depth, 'max_depth' => $args['max_depth']) ) ); ?>

    '; return $defaults; } add_filter('comment_form_defaults', 'adenit_custom_comment_form'); function adenit_custom_comment_fields() { $commenter = wp_get_current_commenter(); $req = get_option('require_name_email'); $aria_req = ($req ?"aria-required = 'true'" : ' ' ); $fields = array( 'author' => '

    ' . ''. ''. '

    ', 'email' => '

    ' . ''. ''. '

    ', 'url' => '

    ' . ''. ''. '

    ', ); return $fields; } add_filter('comment_form_default_fields', 'adenit_custom_comment_fields');