urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); // Create Fonts URL $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); endif; return apply_filters( 'anderson_google_fonts_url', $fonts_url ); } // Setup Function: Registers support for various WordPress features add_action( 'after_setup_theme', 'anderson_setup' ); if ( ! function_exists( 'anderson_setup' ) ): function anderson_setup() { // Set Content Width global $content_width; if ( ! isset( $content_width ) ) $content_width = 860; // init Localization load_theme_textdomain('anderson-lite', get_template_directory() . '/languages' ); // Enable support for Post Thumbnails add_theme_support('post-thumbnails'); set_post_thumbnail_size( 520, 350, true ); // Add Theme Support add_theme_support('automatic-feed-links'); add_theme_support('title-tag'); add_editor_style(); // Add Custom Background add_theme_support('custom-background', array('default-color' => '777777')); // Add Custom Header add_theme_support('custom-header', array( 'header-text' => false, 'width' => 1200, 'height' => 350, 'flex-height' => true)); // Add Theme Support for Anderson Pro Plugin add_theme_support( 'anderson-pro' ); // Register Navigation Menus register_nav_menu( 'primary', __('Main Navigation', 'anderson-lite') ); register_nav_menu( 'secondary', __('Top Navigation', 'anderson-lite') ); register_nav_menu( 'footer', __('Footer Navigation', 'anderson-lite') ); // Register Social Icons Menu register_nav_menu( 'social', __('Social Icons', 'anderson-lite') ); } endif; // Add custom Image Sizes add_action( 'after_setup_theme', 'anderson_add_image_sizes' ); if ( ! function_exists( 'anderson_add_image_sizes' ) ): function anderson_add_image_sizes() { // Add Custom Header Image Size add_image_size( 'anderson-header-image', 1200, 350, true); // Add Category Post Widget image sizes add_image_size( 'anderson-category-posts-widget-small', 120, 80, true); add_image_size( 'anderson-category-posts-widget-big', 520, 300, true); // Add Slider Image Size add_image_size( 'anderson-slider-image', 880, 440, true); } endif; // Register Sidebars add_action( 'widgets_init', 'anderson_register_sidebars' ); if ( ! function_exists( 'anderson_register_sidebars' ) ): function anderson_register_sidebars() { // Register Sidebar register_sidebar( array( 'name' => __( 'Sidebar', 'anderson-lite' ), 'id' => 'sidebar', 'description' => __( 'Appears on posts and pages except Magazine Homepage and Fullwidth template.', 'anderson-lite' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); // Register Magazine Homepage Widgets register_sidebar( array( 'name' => __( 'Magazine Homepage', 'anderson-lite' ), 'id' => 'magazine-homepage', 'description' => __( 'Appears on Magazine Homepage template only. You can use the Category Posts widgets here.', 'anderson-lite' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } endif; // Add title tag for older WordPress versions if ( ! function_exists( '_wp_render_title_tag' ) ) : add_action( 'wp_head', 'anderson_wp_title' ); function anderson_wp_title() { ?> <?php wp_title( '|', true, 'right' ); ?> '. wp_list_pages('title_li=&echo=0') .''; } // Get Featured Posts function anderson_get_featured_content() { return apply_filters( 'anderson_get_featured_content', false ); } // Check if featured posts exists function anderson_has_featured_content() { return ! is_paged() && (bool) anderson_get_featured_content(); } // Change Excerpt Length add_filter('excerpt_length', 'anderson_excerpt_length'); function anderson_excerpt_length($length) { return 30; } // Change Excerpt More add_filter('excerpt_more', 'anderson_excerpt_more'); function anderson_excerpt_more($more) { // Get Theme Options from Database $theme_options = anderson_theme_options(); // Return Excerpt Text if ( isset($theme_options['excerpt_text']) and $theme_options['excerpt_text'] == true ) : return ' [...]'; else : return ''; endif; } // Change Excerpt Length for Featured Content add_filter('excerpt_length', 'anderson_excerpt_length'); function anderson_slideshow_excerpt_length($length) { return 20; } // Change Excerpt Length for Featured Content add_filter('excerpt_length', 'anderson_excerpt_length'); function anderson_category_posts_widgets_excerpt_length($length) { return 20; } // Custom Template for comments and pingbacks. if ( ! function_exists( 'anderson_list_comments' ) ): function anderson_list_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; if( $comment->comment_type == 'pingback' or $comment->comment_type == 'trackback' ) : ?>
  • id="comment-">

    ', '' ); ?>

  • id="comment-">
    %s', get_comment_author_link() ); ?>
    comment_approved == '0') : ?>

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