esc_html__( 'Menu', 'bexley' ), ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'bexley_enqueue' ); /** * Get url for embedding Google fonts. * * Output can be filtered with 'bexley_fonts' filter. * * @return string|boolean Font url or false if there are no fonts. */ function bexley_fonts() { $fonts = array(); /* translators: If there are characters in your language that are not supported by Roboto Slab, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== esc_html_x( 'on', 'Google font: on or off', 'bexley' ) ) { $fonts['roboto-slab'] = 'Roboto Slab:700,300'; } // Filter fonts. Allows them to be disabled/ added to. $fonts = apply_filters( 'bexley_fonts', $fonts ); if ( $fonts ) { // Build font embed query string. $query_args = array( 'family' => rawurlencode( implode( '|', $fonts ) ), 'subset' => rawurlencode( 'latin,latin-ext' ), ); return add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return false; } /** * Set up all the theme properties and extras */ function bexley_after_setup_theme() { add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); load_theme_textdomain( 'bexley', get_template_directory() . '/languages' ); // Post thumbnails. add_theme_support( 'post-thumbnails' ); add_image_size( 'bexley-content', 1100, 9999, false ); add_image_size( 'bexley-archive', 120, 120, true ); // Custom background. $args = array( 'default-color' => 'f2f2f2', ); add_theme_support( 'custom-background', $args ); // HTML5 FTW. add_theme_support( 'html5', array( 'comment-list', 'comment-form' ) ); register_nav_menu( 'top_menu', __( 'Top Menu', 'bexley' ) ); } /** * Initialise widgets */ function bexley_widgets_init() { // Sidebar. register_sidebar( array( 'name' => __( 'Sidebar Widgets', 'bexley' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets that display on the side of your website. Keep this empty to remove the sidebar.', 'bexley' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); // Footer. register_sidebar( array( 'name' => __( 'Footer Widgets', 'bexley' ), 'id' => 'sidebar-2', 'description' => __( 'Widgets that display at the bottom of the website.', 'bexley' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'bexley_widgets_init' ); /** * Change the excerpt more link * * @param type $more * @return type */ function bexley_excerptmore( $more ) { return '… ' . esc_html__( 'Read More', 'bexley' ) . ''; } /** * Custom excerpt length * * @param type $length * @return int */ function bexley_excerpt_length( $length ) { return 40; } /** * Add an id to menus so we can target them directly. * * @param type $ulclass * @return type */ function bexley_add_menu_class( $ulclass ) { return preg_replace( '/