__( 'Main Primary Navigation', 'amp' ), 'secondary' => __( 'Secondary Mobile Navigation', 'amp' ), 'footer' => __( 'Secondary Footer Navigation', 'amp' ) ) ); // supports custom header upload image // Add a filter to image_width and image_height to change the width and height of your custom header. $custom_header_support = array( 'default-image' => get_template_directory_uri() . '/assets/logo-256.png', 'random-default' => false, 'flex-height' => true, 'flex-width' => true, 'uploads' => true, 'header-text' => false, 'width' => 426, 'height' => 100, ); add_theme_support( 'custom-header', $custom_header_support ); /** * Custom background color and image support */ add_theme_support( 'custom-background' ); $args = array( 'default-color' => 'FAFAFB', 'default-image' => '', ); add_theme_support( 'custom-background', $args ); } add_action('after_setup_theme', 'amp_setup'); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function amp_content_width() { // set width of external linked media players not defined $GLOBALS['content_width'] = apply_filters( 'amp_content_width', 720 ); } add_action( 'after_setup_theme', 'amp_content_width', 0 ); function amp_add_theme_scripts() { // Loads default main stylesheet. wp_enqueue_style( 'amp-style', get_stylesheet_uri() ); // Font awsome enqueue wp_enqueue_style( 'amp-font-awesome', get_template_directory_uri() .'/assets/fonts/css/font-awesome.css' ); // Script to help html5 wp_enqueue_script( 'amp-modernizer-js', get_template_directory_uri() .'/assets/modernizr.js', array( 'jquery' ), '', true ); // Script to call up mobile menu wp_enqueue_script( 'amp-mobile', get_template_directory_uri() . '/assets/amp-mobile.js', array('jquery'), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'amp_add_theme_scripts' ); /** * only enable js if the visitor is browsing either a page or a post * or if comments are open for the entry, or threaded comments are enabled */ function amp_theme_queue_js(){ if ( (!is_admin()) && is_singular() && comments_open() && get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' ); } add_action('wp_print_scripts', 'amp_theme_queue_js'); // Add ie conditional html5 shim to header function amp_add_ie_html5_shim () { echo "\n"; } add_action('wp_head', 'amp_add_ie_html5_shim'); /** * Header for singular articles * Add pingback url auto-discovery header for singular articles. */ function amp_pingback_header() { if ( is_singular() && pings_open() ) { printf( '' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'amp_pingback_header' ); /** * Creates a nicely formatted and more specific title element text * for output in head of document, based on current view. * * @since amp 0.4 * * @param string $title Default title text for current view. * @param string $sep Optional separator. * @return string Filtered title. */ function amp_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'amp' ), max( $paged, $page ) ); return $title; } //add_filter( 'wp_title', 'amp_wp_title', 10, 2 ); // the widget invoked here function amp_widgets_init() { register_sidebar(array( 'name' => __('Primary Footer Widget Right Side', 'amp'), 'id' => 'sidebar', 'description' => __('The main footer widget area', 'amp'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'amp_widgets_init' ); /* if ( ! function_exists( '_wp_render_title_tag' ) ) { function amp_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?>