• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentysixteen_fonts_url() – Register Google fonts for Twenty Sixteen.

You appear to be a bot. Output may be restricted

Description

Register Google fonts for Twenty Sixteen.

Create your own twentysixteen_fonts_url() function to override in a child theme.

Usage

$string = twentysixteen_fonts_url();

Parameters

Returns

string Google fonts URL for the theme.

Source

File name: twentysixteen/functions.php
Lines:

1 to 42 of 42
  function twentysixteen_fonts_url() {
    $fonts_url = '';
    $fonts     = array();
    $subsets   = 'latin,latin-ext';

    /*
		 * translators: If there are characters in your language that are not supported
		 * by Merriweather, translate this to 'off'. Do not translate into your own language.
		 */
    if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
      $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic';
    }

    /*
		 * translators: If there are characters in your language that are not supported
		 * by Montserrat, translate this to 'off'. Do not translate into your own language.
		 */
    if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
      $fonts[] = 'Montserrat:400,700';
    }

    /*
		 * translators: If there are characters in your language that are not supported
		 * by Inconsolata, translate this to 'off'. Do not translate into your own language.
		 */
    if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) {
      $fonts[] = 'Inconsolata:400';
    }

    if ( $fonts ) {
      $fonts_url = add_query_arg(
        array(
          'family'  => urlencode( implode( '|', $fonts ) ),
          'subset'  => urlencode( $subsets ),
          'display' => urlencode( 'fallback' ),
        ),
        'https://fonts.googleapis.com/css'
      );
    }

    return $fonts_url;
  }
 

 View on Trac

Published: 25th November 2019 | Last updated: 8th April 2020

Primary Sidebar

Information

Function name: twentysixteen_fonts_url
Plugin ref: Twenty Sixteen
Version: 2.8
Sourcefile: functions.php
File ref: functions.php
Deprecated?: No
API Letters: F,T,U

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.27
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites