__( 'Primary Menu', 'adamos' ),
) );
/**
* Add support for post thumbnails
*/
add_theme_support('post-thumbnails');
add_image_size( 'featured', 650, 300, true );
add_image_size( 100, 300, true);
add_image_size( 'frontpage-thumbnail', 460, 160, true);
/**
* Add support for the Aside Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', ) );
// Add support for a custom header image
add_theme_support( 'custom-header' );
// Display Title in theme
add_theme_support( 'title-tag' );
// link a custom stylesheet file to the TinyMCE visual editor
$font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Open+Sans' );
add_editor_style( array('style.css', 'css/editor-style.css', $font_url) );
}
endif; // adamos_setup
add_action( 'after_setup_theme', 'adamos_setup' );
/**
* Setup the WordPress core custom background feature.
*
* Use add_theme_support to register support for WordPress 3.4+
* as well as provide backward compatibility for previous versions.
* Use feature detection of wp_get_theme() which was introduced
* in WordPress 3.4.
*
* Hooks into the after_setup_theme action.
*
* @since adamos 1.0
*/
function adamos_register_custom_background() {
$args = array(
'default-color' => 'EEE',
);
$args = apply_filters( 'adamos_custom_background_args', $args );
if ( function_exists( 'wp_get_theme' ) ) {
add_theme_support( 'custom-background', $args );
} else {
define( 'BACKGROUND_COLOR', $args['default-color'] );
define( 'BACKGROUND_IMAGE', $args['default-image'] );
add_theme_support( 'custom-background', $args );
}
}
add_action( 'after_setup_theme', 'adamos_register_custom_background' );
/**
* Register widgetized area and update sidebar with default widgets
*
* @since adamos 1.0
*/
function adamos_widgets_init() {
register_sidebar( array(
'name' => __( 'Primary Sidebar', 'adamos' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Secondary Sidebar', 'adamos' ),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Left Sidebar', 'adamos' ),
'id' => 'sidebar-3',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar(array(
'name' => 'Left Footer Column',
'id' => 'left_column',
'description' => 'Widget area for footer left column',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'name' => 'Center Footer Column',
'id' => 'center_column',
'description' => 'Widget area for footer center column',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'name' => 'Right Footer Column',
'id' => 'right_column',
'description' => 'Widget area for footer right column',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
}
add_action( 'widgets_init', 'adamos_widgets_init' );
/**
* Enqueue scripts and styles
*/
function adamos_scripts() {
wp_enqueue_style( 'adamos-style', get_stylesheet_uri() );
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', '', '2.0');
wp_enqueue_style( 'jquery-flexslider', get_template_directory_uri() . '/css/flexslider.css', '', '2.0');
wp_enqueue_script( 'jquery-small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '2.0', true );
wp_enqueue_script( 'jquery-smoothup', get_template_directory_uri() . '/js/smoothscroll.js', array( 'jquery' ), '2.0', true );
wp_enqueue_script( 'jquery-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '2.0', true );
wp_enqueue_script( 'jquery-flexslider', get_template_directory_uri() .'/js/jquery.flexslider-min.js', array('jquery'), '2.0', true);
wp_enqueue_script( 'jquery-flexslider-init', get_template_directory_uri() .'/js/flexslider-init.js', array('jquery-flexslider'), '2.0', true);
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'adamos_scripts' );
/**
* Implement excerpt for homepage slider
*/
function adamos_get_slider_excerpt(){
$excerpt = get_the_content();
$excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
$excerpt = strip_shortcodes($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, 150);
$excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
return $excerpt;
}
// Theme Options
include('functions/customizer_controller.php');
include('functions/customizer_settings.php');
include('functions/customizer_styles.php');
/**
* Implement excerpt for homepage thumbnails
*/
function adamos_content( $limit ) {
$content = explode(' ', get_the_content(), $limit);
if ( count( $content )>=$limit ) {
array_pop($content);
$content = implode( " ", $content ).'...';
} else {
$content = implode( " ", $content );
}
$content = preg_replace( '/\[.+\]/','', $content );
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
return $content;
}
/**
* Filters the page title appropriately depending on the current page
*
* This function is attached to the 'wp_title' fiilter hook.
*
* @uses get_bloginfo()
* @uses is_home()
* @uses is_front_page()
*/
function adamos_wp_title( $title ) {
global $page, $paged;
if ( is_feed() )
return $title;
$site_description = get_bloginfo( 'description' );
$filtered_title = $title . get_bloginfo( 'name' );
$filtered_title .= ( ! empty( $site_description ) && ( is_home() || is_front_page() ) ) ? ' | ' . $site_description: '';
$filtered_title .= ( 2 <= $paged || 2 <= $page ) ? ' | ' . sprintf( __( 'Page %s', 'adamos' ), max( $paged, $page ) ) : '';
return $filtered_title;
}
add_filter( 'wp_title', 'adamos_wp_title' );
/**
* Social Media Links on Contributors template
*/
function author_social_media( $socialmedialinks ) {
$socialmedialinks['alternate_image'] = __('Alternate Profile Image Url', 'adamos');
$socialmedialinks['google_profile'] = 'Google+ URL';
$socialmedialinks['twitter_profile'] = 'Twitter URL';
$socialmedialinks['facebook_profile'] = 'Facebook URL';
$socialmedialinks['linkedin_profile'] = 'Linkedin URL';
return $socialmedialinks;
}
add_filter( 'user_contactmethods', 'author_social_media', 10, 1);
/**
* Implement the Custom Header feature
*/
function adamos_custom_header_setup() {
$args = array(
'default-image' => '',
'default-text-color' => 'FFF',
'width' => 1400,
'height' => 500,
'flex-height' => true,
'wp-head-callback' => 'adamos_header_style',
'admin-head-callback' => 'adamos_admin_header_style',
'admin-preview-callback' => 'adamos_admin_header_image',
);
$args = apply_filters( 'adamos_custom_header_args', $args );
if ( function_exists( 'wp_get_theme' ) ) {
add_theme_support( 'custom-header', $args );
}
}
add_action( 'after_setup_theme', 'adamos_custom_header_setup' );
if ( ! function_exists( 'adamos_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see adamos_custom_header_setup().
*
* @since adamos 1.0
*/
function adamos_header_style() {
// If no custom options for text are set, let's bail
// get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
if ( HEADER_TEXTCOLOR == get_header_textcolor() && '' == get_header_image() )
return;
// If we get this far, we have custom styles. Let's do this.
?>
Header admin panel.
*
* @see adamos_custom_header_setup().
*
* @since adamos 1.0
*/
function adamos_admin_header_style() {
?>
Header admin panel.
*
* @see adamos_custom_header_setup().
*
* @since adamos 1.0
*/
function adamos_admin_header_image() { ?>
>