__( 'Main Menu', 'alienscience' ), )); /** * Add support for the Aside and Gallery Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'gallery' ) ); /** * Add support for Title tags */ add_theme_support( 'title-tag' ); add_image_size( 'alienscience_logo', 240, 60 ); add_theme_support( 'custom-logo', array( 'size' => 'alienscience_logo' ) ); add_theme_support( 'custom-background' ); add_image_size( 'alienscience_slide', 300, 200 ); } endif; // alienscience_setup /** * Enqueue scripts */ add_action( 'wp_enqueue_scripts', 'alienscience_scripts' ); if ( ! function_exists( 'alienscience_scripts' ) ): function alienscience_scripts() { wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', false, '1.0' ); // Register scripts and set dependencies wp_register_script( 'easing', get_template_directory_uri() . '/js/jquery.easing.js', 'jquery' ); wp_register_script( 'slider', get_template_directory_uri() . '/js/jquery.slider.min.js', 'jquery', 'easing' ); wp_register_script( 'animatebackground', get_template_directory_uri() . '/js/jquery.animatebackground.js', 'jquery' ); wp_register_script( 'alienscience', get_template_directory_uri() . '/as.js', 'jquery', 'slider', 'animatebackground' ); // Queue scripts for dynamic linking wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'easing' ); wp_enqueue_script( 'slider' ); wp_enqueue_script( 'animatebackground' ); wp_enqueue_script( 'alienscience' ); // Add support and z-index fixing for flash embeds wp_enqueue_script( 'swfobject' ); } endif; /** * Tell WordPress to run alienscience_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'alienscience_setup' ); /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function alienscience_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'alienscience_page_menu_args' ); /** * Register widgetized area and update sidebar with default widgets */ function alienscience_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'alienscience' ), 'id' => 'main-sidebar', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer', 'alienscience' ), 'id' => 'footer-sidebar', 'description' => __( 'Max. 3 widgets.', 'alienscience' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'alienscience_widgets_init' ); /** * Display navigation to next/previous pages when applicable */ if ( ! function_exists( 'alienscience_content_nav' ) ): function alienscience_content_nav( $nav_id ) { global $wp_query; ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    said:', 'alienscience' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    Posted on by ', 'alienscience' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'alienscience' ), get_the_author() ) ), esc_html( get_the_author() ) ); } endif; /** * Add custom classes to the array of body classes. */ function alienscience_body_classes( $classes ) { // Adds a class of single-author to blogs with only 1 published author if ( ! is_multi_author() ) { $classes[] = 'single-author'; } return $classes; } add_filter( 'body_class', 'alienscience_body_classes' ); /** * Return true if a blog has more than 1 category */ function alienscience_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) { // Create an array of all the categories that are attached to posts $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'all_the_cool_cats', $all_the_cool_cats ); } if ( '1' != $all_the_cool_cats ) { // This blog has more than 1 category so alienscience_categorized_blog should return true return true; } else { // This blog has only 1 category so alienscience_categorized_blog should return false return false; } } /** * Flush out the transients used in alienscience_categorized_blog */ function alienscience_category_transient_flusher() { delete_transient( 'all_the_cool_cats' ); } add_action( 'edit_category', 'alienscience_category_transient_flusher' ); add_action( 'save_post', 'alienscience_category_transient_flusher' ); /** * Custom logo */ function alienscience_custom_logo() { $output = ''; if (function_exists('get_custom_logo')) $output = get_custom_logo(); if (empty($output)) $output = '

    ' . get_bloginfo('name') . '

    ' . get_bloginfo('description') . '
    '; echo $output; } /** * Admin functions */ add_action('admin_head', 'alienscience_admin_header_print'); function alienscience_admin_header_print() { echo ''; } /** * Admin notices */ function alienscience_update_notice() { if ( !get_theme_mod( 'alienscience_credit_link' ) ) { return; } ?>

    add_section( 'alienscience_footer' , array( 'title' => __( 'Footer', 'alienscience' ), 'priority' => 117, ) ); // Credit link $wp_customize->add_setting( 'alienscience_credit_link' , array( 'default' => 0, 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'alienscience_credit_link', array( 'label' => __('Hide Credit', 'alienscience'), 'section' => 'alienscience_footer', 'settings' => 'alienscience_credit_link', 'type' => 'checkbox', ) ) ); // Copyright text $wp_customize->add_setting( 'alienscience_copyright_text' , array( 'default' => 'Published under the creative commons licence.', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'alienscience_copyright_text', array( 'label' => __('Copyright Text', 'alienscience'), 'section' => 'alienscience_footer', 'settings' => 'alienscience_copyright_text', 'type' => 'text', ) ) ); // Footer logo $wp_customize->add_setting( 'alienscience_footer_logo', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'alienscience_footer_logo', array( 'label' => __( 'Footer Logo', 'alienscience' ), 'section' => 'alienscience_footer', 'settings' => 'alienscience_footer_logo', ) ) ); } add_action( 'customize_register', 'alienscience_custom_settings' ); /** * This theme was built with PHP, Semantic HTML5, jQuery, CSS and Alien Science by Higher Coding. */