'ffffff', 'border' => 'e6e6e6', 'text' => '333333', 'link' => '428ce7', 'url' => '428ce7', ); break; default: $themecolors = array( 'bg' => '111111', 'border' => '515151', 'text' => 'eeeeee', 'link' => '428ce7', 'url' => '428ce7', ); break; } } //Set the content width based on the theme's design and stylesheet. if ( ! isset( $content_width ) ) $content_width = 950; /* pixels */ //Adjust the content width on non-singular pages. function modularity_set_content_width() { global $content_width; $options = get_option( 'modularity_theme_options' ); if ( ( isset( $options['sidebar'] ) && 1 == $options['sidebar'] ) && ! is_page_template( 'full-width-page.php' ) ) { $content_width = 590; } } add_action( 'template_redirect', 'modularity_set_content_width' ); function modularity_setup() { //Add support for post formats add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); // Add post thumbnail theme support add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 150, 150, true ); // Add a new image size add_image_size( 'modularity-slideshow', 950, 425, true ); // Register nav menu locations register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'text_domain' ), ) ); // Give Modularity a custom background add_theme_support( 'custom-background' ); load_theme_textdomain( 'modularity', get_template_directory() . '/languages' ); } add_action( 'after_setup_theme', 'modularity_setup' ); /** * Enqueue scripts and styles */ function modularity_scripts() { global $wp_styles; wp_enqueue_style( 'modularity', get_stylesheet_uri() ); wp_enqueue_style( 'modularity-screen', get_template_directory_uri() . '/library/styles/screen.css', array( 'modularity' ), false, 'screen, projection' ); wp_enqueue_style( 'modularity-print', get_template_directory_uri() . '/library/styles/print.css', array( 'modularity' ), false, 'print' ); wp_enqueue_style( 'modularity-ie', get_template_directory_uri() . '/library/styles/ie.css', array( 'modularity', 'modularity-screen' ) ); $wp_styles->add_data( 'modularity-ie', 'conditional', 'lte IE 8' ); wp_enqueue_style( 'modularity-ie-nav', get_template_directory_uri() . '/library/styles/ie-nav.css', array( 'modularity', 'modularity-screen' ) ); $wp_styles->add_data( 'modularity-ie-nav', 'conditional', 'lte IE 7' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); $options = modularity_get_options(); if ( is_home() && ! is_paged() && isset( $options['slideshow'] ) && $options['slideshow'] != 0) { wp_enqueue_style( 'modularity-flexslider-style', get_template_directory_uri() . '/js/flexslider/flexslider.css' ); wp_enqueue_script( 'modularity-flexslider-script', get_template_directory_uri() . '/js/flexslider/flexslider.js', array( 'jquery' ), '20130805', true ); } } add_action( 'wp_enqueue_scripts', 'modularity_scripts' ); // Get wp_page_menu() lookin' more like wp_nav_menu() function modularity_page_menu_args( $args ) { $args['show_home'] = true; $args['menu_class'] = 'main-nav'; return $args; } add_filter( 'wp_page_menu_args', 'modularity_page_menu_args' ); // Allow custom colors to clear the background image function modularity_custom_background_color() { if ( get_background_image() == '' && get_background_color() != '' ) { ?> 'dark', ); $options = get_option( 'modularity_theme_options', $defaults ); return $options; } // Register our color schemes and add them to the style queue function modularity_color_registrar() { $options = modularity_get_options(); $color_scheme = $options['color_scheme'] ?? ''; if ( ! empty( $color_scheme ) && $color_scheme != 'dark' ) { wp_register_style( $color_scheme, get_template_directory_uri() . '/' . $color_scheme . '.css', null, null ); wp_enqueue_style( $color_scheme ); } } add_action( 'wp_enqueue_scripts', 'modularity_color_registrar' ); // To use a sidebar, or not to use a sidebar, that is the question. This generates the appropriate class. function modularity_sidebar_class() { $options = get_option( 'modularity_theme_options' ); // If we're using a sidebar ... if ( isset( $options['sidebar'] ) && $options['sidebar'] == 1 ) { echo "15 colborder site-content"; } // If we're not using a sidebar ... else { echo "24 last"; } } function modularity_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'modularity_custom_header_args', array( 'default-image' => '', 'default-text-color' => '', 'header-text' => false, 'width' => 950, 'height' => 200, 'admin-head-callback' => 'modularity_admin_header_style', ) ) ); } add_action( 'after_setup_theme', 'modularity_custom_header_setup' ); function modularity_admin_header_style() { ?> comment_type ) : case 'pingback' : case 'trackback' : ?>