[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyfourteen/ -> functions.php (source)

   1  <?php
   2  /**
   3   * Twenty Fourteen functions and definitions
   4   *
   5   * Set up the theme and provides some helper functions, which are used in the
   6   * theme as custom template tags. Others are attached to action and filter
   7   * hooks in WordPress to change core functionality.
   8   *
   9   * When using a child theme you can override certain functions (those wrapped
  10   * in a function_exists() call) by defining them first in your child theme's
  11   * functions.php file. The child theme's functions.php file is included before
  12   * the parent theme's file, so the child theme functions would be used.
  13   *
  14   * @link https://developer.wordpress.org/themes/basics/theme-functions/
  15   * @link https://developer.wordpress.org/themes/advanced-topics/child-themes/
  16   *
  17   * Functions that are not pluggable (not wrapped in function_exists()) are
  18   * instead attached to a filter or action hook.
  19   *
  20   * For more information on hooks, actions, and filters,
  21   * @link https://developer.wordpress.org/plugins/
  22   *
  23   * @package WordPress
  24   * @subpackage Twenty_Fourteen
  25   * @since Twenty Fourteen 1.0
  26   */
  27  
  28  /**
  29   * Set up the content width value based on the theme's design.
  30   *
  31   * @see twentyfourteen_content_width()
  32   *
  33   * @since Twenty Fourteen 1.0
  34   */
  35  if ( ! isset( $content_width ) ) {
  36      $content_width = 474;
  37  }
  38  
  39  /**
  40   * Twenty Fourteen only works in WordPress 3.6 or later.
  41   */
  42  if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) {
  43      require get_template_directory() . '/inc/back-compat.php';
  44  }
  45  
  46  if ( ! function_exists( 'twentyfourteen_setup' ) ) :
  47      /**
  48       * Twenty Fourteen setup.
  49       *
  50       * Set up theme defaults and registers support for various WordPress features.
  51       *
  52       * Note that this function is hooked into the after_setup_theme hook, which
  53       * runs before the init hook. The init hook is too late for some features, such
  54       * as indicating support post thumbnails.
  55       *
  56       * @since Twenty Fourteen 1.0
  57       */
  58  	function twentyfourteen_setup() {
  59  
  60          /*
  61           * Make Twenty Fourteen available for translation.
  62           *
  63           * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen
  64           * If you're building a theme based on Twenty Fourteen, use a find and
  65           * replace to change 'twentyfourteen' to the name of your theme in all
  66           * template files.
  67           */
  68          load_theme_textdomain( 'twentyfourteen' );
  69  
  70          // This theme styles the visual editor to resemble the theme style.
  71          add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) );
  72  
  73          // Load regular editor styles into the new block-based editor.
  74          add_theme_support( 'editor-styles' );
  75  
  76          // Load default block styles.
  77          add_theme_support( 'wp-block-styles' );
  78  
  79          // Add support for responsive embeds.
  80          add_theme_support( 'responsive-embeds' );
  81  
  82          // Add support for custom color scheme.
  83          add_theme_support(
  84              'editor-color-palette',
  85              array(
  86                  array(
  87                      'name'  => __( 'Green', 'twentyfourteen' ),
  88                      'slug'  => 'green',
  89                      'color' => '#24890d',
  90                  ),
  91                  array(
  92                      'name'  => __( 'Black', 'twentyfourteen' ),
  93                      'slug'  => 'black',
  94                      'color' => '#000',
  95                  ),
  96                  array(
  97                      'name'  => __( 'Dark Gray', 'twentyfourteen' ),
  98                      'slug'  => 'dark-gray',
  99                      'color' => '#2b2b2b',
 100                  ),
 101                  array(
 102                      'name'  => __( 'Medium Gray', 'twentyfourteen' ),
 103                      'slug'  => 'medium-gray',
 104                      'color' => '#767676',
 105                  ),
 106                  array(
 107                      'name'  => __( 'Light Gray', 'twentyfourteen' ),
 108                      'slug'  => 'light-gray',
 109                      'color' => '#f5f5f5',
 110                  ),
 111                  array(
 112                      'name'  => __( 'White', 'twentyfourteen' ),
 113                      'slug'  => 'white',
 114                      'color' => '#fff',
 115                  ),
 116              )
 117          );
 118  
 119          // Add RSS feed links to <head> for posts and comments.
 120          add_theme_support( 'automatic-feed-links' );
 121  
 122          // Enable support for Post Thumbnails, and declare two sizes.
 123          add_theme_support( 'post-thumbnails' );
 124          set_post_thumbnail_size( 672, 372, true );
 125          add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
 126  
 127          // This theme uses wp_nav_menu() in two locations.
 128          register_nav_menus(
 129              array(
 130                  'primary'   => __( 'Top primary menu', 'twentyfourteen' ),
 131                  'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ),
 132              )
 133          );
 134  
 135          /*
 136           * Switch default core markup for search form, comment form, and comments
 137           * to output valid HTML5.
 138           */
 139          add_theme_support(
 140              'html5',
 141              array(
 142                  'search-form',
 143                  'comment-form',
 144                  'comment-list',
 145                  'gallery',
 146                  'caption',
 147                  'script',
 148                  'style',
 149              )
 150          );
 151  
 152          /*
 153           * Enable support for Post Formats.
 154           * See https://wordpress.org/support/article/post-formats/
 155           */
 156          add_theme_support(
 157              'post-formats',
 158              array(
 159                  'aside',
 160                  'image',
 161                  'video',
 162                  'audio',
 163                  'quote',
 164                  'link',
 165                  'gallery',
 166              )
 167          );
 168  
 169          // This theme allows users to set a custom background.
 170          add_theme_support(
 171              'custom-background',
 172              /**
 173               * Filters Twenty Fourteen custom-background support arguments.
 174               *
 175               * @since Twenty Fourteen 1.0
 176               *
 177               * @param array $args {
 178               *     An array of custom-background support arguments.
 179               *
 180               *     @type string $default-color Default color of the background.
 181               * }
 182               */
 183              apply_filters(
 184                  'twentyfourteen_custom_background_args',
 185                  array(
 186                      'default-color' => 'f5f5f5',
 187                  )
 188              )
 189          );
 190  
 191          // Add support for featured content.
 192          add_theme_support(
 193              'featured-content',
 194              array(
 195                  'featured_content_filter' => 'twentyfourteen_get_featured_posts',
 196                  'max_posts'               => 6,
 197              )
 198          );
 199  
 200          // This theme uses its own gallery styles.
 201          add_filter( 'use_default_gallery_style', '__return_false' );
 202  
 203          // Indicate widget sidebars can use selective refresh in the Customizer.
 204          add_theme_support( 'customize-selective-refresh-widgets' );
 205      }
 206  endif; // twentyfourteen_setup()
 207  add_action( 'after_setup_theme', 'twentyfourteen_setup' );
 208  
 209  /**
 210   * Adjust content_width value for image attachment template.
 211   *
 212   * @since Twenty Fourteen 1.0
 213   */
 214  function twentyfourteen_content_width() {
 215      if ( is_attachment() && wp_attachment_is_image() ) {
 216          $GLOBALS['content_width'] = 810;
 217      }
 218  }
 219  add_action( 'template_redirect', 'twentyfourteen_content_width' );
 220  
 221  /**
 222   * Getter function for Featured Content Plugin.
 223   *
 224   * @since Twenty Fourteen 1.0
 225   *
 226   * @return array An array of WP_Post objects.
 227   */
 228  function twentyfourteen_get_featured_posts() {
 229      /**
 230       * Filters the featured posts to return in Twenty Fourteen.
 231       *
 232       * @since Twenty Fourteen 1.0
 233       *
 234       * @param array|bool $posts Array of featured posts, otherwise false.
 235       */
 236      return apply_filters( 'twentyfourteen_get_featured_posts', array() );
 237  }
 238  
 239  /**
 240   * A helper conditional function that returns a boolean value.
 241   *
 242   * @since Twenty Fourteen 1.0
 243   *
 244   * @return bool Whether there are featured posts.
 245   */
 246  function twentyfourteen_has_featured_posts() {
 247      return ! is_paged() && (bool) twentyfourteen_get_featured_posts();
 248  }
 249  
 250  /**
 251   * Register three Twenty Fourteen widget areas.
 252   *
 253   * @since Twenty Fourteen 1.0
 254   */
 255  function twentyfourteen_widgets_init() {
 256      require get_template_directory() . '/inc/widgets.php';
 257      register_widget( 'Twenty_Fourteen_Ephemera_Widget' );
 258  
 259      register_sidebar(
 260          array(
 261              'name'          => __( 'Primary Sidebar', 'twentyfourteen' ),
 262              'id'            => 'sidebar-1',
 263              'description'   => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
 264              'before_widget' => '<aside id="%1$s" class="widget %2$s">',
 265              'after_widget'  => '</aside>',
 266              'before_title'  => '<h1 class="widget-title">',
 267              'after_title'   => '</h1>',
 268          )
 269      );
 270      register_sidebar(
 271          array(
 272              'name'          => __( 'Content Sidebar', 'twentyfourteen' ),
 273              'id'            => 'sidebar-2',
 274              'description'   => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ),
 275              'before_widget' => '<aside id="%1$s" class="widget %2$s">',
 276              'after_widget'  => '</aside>',
 277              'before_title'  => '<h1 class="widget-title">',
 278              'after_title'   => '</h1>',
 279          )
 280      );
 281      register_sidebar(
 282          array(
 283              'name'          => __( 'Footer Widget Area', 'twentyfourteen' ),
 284              'id'            => 'sidebar-3',
 285              'description'   => __( 'Appears in the footer section of the site.', 'twentyfourteen' ),
 286              'before_widget' => '<aside id="%1$s" class="widget %2$s">',
 287              'after_widget'  => '</aside>',
 288              'before_title'  => '<h1 class="widget-title">',
 289              'after_title'   => '</h1>',
 290          )
 291      );
 292  }
 293  add_action( 'widgets_init', 'twentyfourteen_widgets_init' );
 294  
 295  /**
 296   * Register Lato Google font for Twenty Fourteen.
 297   *
 298   * @since Twenty Fourteen 1.0
 299   *
 300   * @return string
 301   */
 302  function twentyfourteen_font_url() {
 303      $font_url = '';
 304      /*
 305       * translators: If there are characters in your language that are not supported
 306       * by Lato, translate this to 'off'. Do not translate into your own language.
 307       */
 308      if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) {
 309          $query_args = array(
 310              'family'  => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ),
 311              'subset'  => urlencode( 'latin,latin-ext' ),
 312              'display' => urlencode( 'fallback' ),
 313          );
 314          $font_url   = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
 315      }
 316  
 317      return $font_url;
 318  }
 319  
 320  /**
 321   * Enqueue scripts and styles for the front end.
 322   *
 323   * @since Twenty Fourteen 1.0
 324   */
 325  function twentyfourteen_scripts() {
 326      // Add Lato font, used in the main stylesheet.
 327      wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
 328  
 329      // Add Genericons font, used in the main stylesheet.
 330      wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.3' );
 331  
 332      // Load our main stylesheet.
 333      wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array(), '20190507' );
 334  
 335      // Theme block stylesheet.
 336      wp_enqueue_style( 'twentyfourteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfourteen-style' ), '20190102' );
 337  
 338      // Load the Internet Explorer specific stylesheet.
 339      wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20140701' );
 340      wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
 341  
 342      if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
 343          wp_enqueue_script( 'comment-reply' );
 344      }
 345  
 346      if ( is_singular() && wp_attachment_is_image() ) {
 347          wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20150120' );
 348      }
 349  
 350      if ( is_active_sidebar( 'sidebar-3' ) ) {
 351          wp_enqueue_script( 'jquery-masonry' );
 352      }
 353  
 354      if ( is_front_page() && 'slider' === get_theme_mod( 'featured_content_layout' ) ) {
 355          wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20150120', true );
 356          wp_localize_script(
 357              'twentyfourteen-slider',
 358              'featuredSliderDefaults',
 359              array(
 360                  'prevText' => __( 'Previous', 'twentyfourteen' ),
 361                  'nextText' => __( 'Next', 'twentyfourteen' ),
 362              )
 363          );
 364      }
 365  
 366      wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20171218', true );
 367  }
 368  add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
 369  
 370  /**
 371   * Enqueue Google fonts style to admin screen for custom header display.
 372   *
 373   * @since Twenty Fourteen 1.0
 374   */
 375  function twentyfourteen_admin_fonts() {
 376      wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
 377  }
 378  add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' );
 379  
 380  /**
 381   * Add preconnect for Google Fonts.
 382   *
 383   * @since Twenty Fourteen 1.9
 384   *
 385   * @param array   $urls          URLs to print for resource hints.
 386   * @param string  $relation_type The relation type the URLs are printed.
 387   * @return array URLs to print for resource hints.
 388   */
 389  function twentyfourteen_resource_hints( $urls, $relation_type ) {
 390      if ( wp_style_is( 'twentyfourteen-lato', 'queue' ) && 'preconnect' === $relation_type ) {
 391          if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) {
 392              $urls[] = array(
 393                  'href' => 'https://fonts.gstatic.com',
 394                  'crossorigin',
 395              );
 396          } else {
 397              $urls[] = 'https://fonts.gstatic.com';
 398          }
 399      }
 400  
 401      return $urls;
 402  }
 403  add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 );
 404  
 405  /**
 406   * Enqueue styles for the block-based editor.
 407   *
 408   * @since Twenty Fourteen 2.3
 409   */
 410  function twentyfourteen_block_editor_styles() {
 411      // Block styles.
 412      wp_enqueue_style( 'twentyfourteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20190102' );
 413      // Add custom fonts.
 414      wp_enqueue_style( 'twentyfourteen-fonts', twentyfourteen_font_url(), array(), null );
 415  }
 416  add_action( 'enqueue_block_editor_assets', 'twentyfourteen_block_editor_styles' );
 417  
 418  if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) :
 419      /**
 420       * Print the attached image with a link to the next attached image.
 421       *
 422       * @since Twenty Fourteen 1.0
 423       */
 424  	function twentyfourteen_the_attached_image() {
 425          $post = get_post();
 426          /**
 427           * Filters the default Twenty Fourteen attachment size.
 428           *
 429           * @since Twenty Fourteen 1.0
 430           *
 431           * @param array $dimensions {
 432           *     An array of height and width dimensions.
 433           *
 434           *     @type int $height Height of the image in pixels. Default 810.
 435           *     @type int $width  Width of the image in pixels. Default 810.
 436           * }
 437           */
 438          $attachment_size     = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) );
 439          $next_attachment_url = wp_get_attachment_url();
 440  
 441          /*
 442           * Grab the IDs of all the image attachments in a gallery so we can get the URL
 443           * of the next adjacent image in a gallery, or the first image (if we're
 444           * looking at the last image in a gallery), or, in a gallery of one, just the
 445           * link to that image file.
 446           */
 447          $attachment_ids = get_posts(
 448              array(
 449                  'post_parent'    => $post->post_parent,
 450                  'fields'         => 'ids',
 451                  'numberposts'    => -1,
 452                  'post_status'    => 'inherit',
 453                  'post_type'      => 'attachment',
 454                  'post_mime_type' => 'image',
 455                  'order'          => 'ASC',
 456                  'orderby'        => 'menu_order ID',
 457              )
 458          );
 459  
 460          // If there is more than 1 attachment in a gallery...
 461          if ( count( $attachment_ids ) > 1 ) {
 462              foreach ( $attachment_ids as $idx => $attachment_id ) {
 463                  if ( $attachment_id == $post->ID ) {
 464                      $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
 465                      break;
 466                  }
 467              }
 468  
 469              if ( $next_id ) {
 470                  // ...get the URL of the next image attachment.
 471                  $next_attachment_url = get_attachment_link( $next_id );
 472              } else {
 473                  // ...or get the URL of the first image attachment.
 474                  $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
 475              }
 476          }
 477  
 478          printf(
 479              '<a href="%1$s" rel="attachment">%2$s</a>',
 480              esc_url( $next_attachment_url ),
 481              wp_get_attachment_image( $post->ID, $attachment_size )
 482          );
 483      }
 484  endif;
 485  
 486  if ( ! function_exists( 'twentyfourteen_list_authors' ) ) :
 487      /**
 488       * Print a list of all site contributors who published at least one post.
 489       *
 490       * @since Twenty Fourteen 1.0
 491       */
 492  	function twentyfourteen_list_authors() {
 493          $contributor_ids = get_users(
 494              array(
 495                  'fields'  => 'ID',
 496                  'orderby' => 'post_count',
 497                  'order'   => 'DESC',
 498                  'who'     => 'authors',
 499              )
 500          );
 501  
 502          foreach ( $contributor_ids as $contributor_id ) :
 503              $post_count = count_user_posts( $contributor_id );
 504  
 505              // Move on if user has not published a post (yet).
 506              if ( ! $post_count ) {
 507                  continue;
 508              }
 509              ?>
 510  
 511          <div class="contributor">
 512          <div class="contributor-info">
 513              <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
 514              <div class="contributor-summary">
 515                  <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
 516                  <p class="contributor-bio">
 517                      <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
 518                  </p>
 519                  <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
 520                      <?php
 521                      /* translators: %d: Post count. */
 522                      printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count );
 523                      ?>
 524                  </a>
 525              </div><!-- .contributor-summary -->
 526          </div><!-- .contributor-info -->
 527      </div><!-- .contributor -->
 528  
 529              <?php
 530      endforeach;
 531      }
 532  endif;
 533  
 534  /**
 535   * Extend the default WordPress body classes.
 536   *
 537   * Adds body classes to denote:
 538   * 1. Single or multiple authors.
 539   * 2. Presence of header image except in Multisite signup and activate pages.
 540   * 3. Index views.
 541   * 4. Full-width content layout.
 542   * 5. Presence of footer widgets.
 543   * 6. Single views.
 544   * 7. Featured content layout.
 545   *
 546   * @since Twenty Fourteen 1.0
 547   *
 548   * @param array $classes A list of existing body class values.
 549   * @return array The filtered body class list.
 550   */
 551  function twentyfourteen_body_classes( $classes ) {
 552      if ( is_multi_author() ) {
 553          $classes[] = 'group-blog';
 554      }
 555  
 556      if ( get_header_image() ) {
 557          $classes[] = 'header-image';
 558      } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ), true ) ) {
 559          $classes[] = 'masthead-fixed';
 560      }
 561  
 562      if ( is_archive() || is_search() || is_home() ) {
 563          $classes[] = 'list-view';
 564      }
 565  
 566      if ( ( ! is_active_sidebar( 'sidebar-2' ) )
 567          || is_page_template( 'page-templates/full-width.php' )
 568          || is_page_template( 'page-templates/contributors.php' )
 569          || is_attachment() ) {
 570          $classes[] = 'full-width';
 571      }
 572  
 573      if ( is_active_sidebar( 'sidebar-3' ) ) {
 574          $classes[] = 'footer-widgets';
 575      }
 576  
 577      if ( is_singular() && ! is_front_page() ) {
 578          $classes[] = 'singular';
 579      }
 580  
 581      if ( is_front_page() && 'slider' === get_theme_mod( 'featured_content_layout' ) ) {
 582          $classes[] = 'slider';
 583      } elseif ( is_front_page() ) {
 584          $classes[] = 'grid';
 585      }
 586  
 587      return $classes;
 588  }
 589  add_filter( 'body_class', 'twentyfourteen_body_classes' );
 590  
 591  /**
 592   * Extend the default WordPress post classes.
 593   *
 594   * Adds a post class to denote:
 595   * Non-password protected page with a post thumbnail.
 596   *
 597   * @since Twenty Fourteen 1.0
 598   *
 599   * @param array $classes A list of existing post class values.
 600   * @return array The filtered post class list.
 601   */
 602  function twentyfourteen_post_classes( $classes ) {
 603      if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) {
 604          $classes[] = 'has-post-thumbnail';
 605      }
 606  
 607      return $classes;
 608  }
 609  add_filter( 'post_class', 'twentyfourteen_post_classes' );
 610  
 611  /**
 612   * Create a nicely formatted and more specific title element text for output
 613   * in head of document, based on current view.
 614   *
 615   * @since Twenty Fourteen 1.0
 616   *
 617   * @global int $paged WordPress archive pagination page count.
 618   * @global int $page  WordPress paginated post page count.
 619   *
 620   * @param string $title Default title text for current view.
 621   * @param string $sep Optional separator.
 622   * @return string The filtered title.
 623   */
 624  function twentyfourteen_wp_title( $title, $sep ) {
 625      global $paged, $page;
 626  
 627      if ( is_feed() ) {
 628          return $title;
 629      }
 630  
 631      // Add the site name.
 632      $title .= get_bloginfo( 'name', 'display' );
 633  
 634      // Add the site description for the home/front page.
 635      $site_description = get_bloginfo( 'description', 'display' );
 636      if ( $site_description && ( is_home() || is_front_page() ) ) {
 637          $title = "$title $sep $site_description";
 638      }
 639  
 640      // Add a page number if necessary.
 641      if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
 642          /* translators: %s: Page number. */
 643          $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) );
 644      }
 645  
 646      return $title;
 647  }
 648  add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
 649  
 650  
 651  /**
 652   * Modifies tag cloud widget arguments to display all tags in the same font size
 653   * and use list format for better accessibility.
 654   *
 655   * @since Twenty Fourteen 2.1
 656   *
 657   * @param array $args Arguments for tag cloud widget.
 658   * @return array The filtered arguments for tag cloud widget.
 659   */
 660  function twentyfourteen_widget_tag_cloud_args( $args ) {
 661      $args['largest']  = 22;
 662      $args['smallest'] = 8;
 663      $args['unit']     = 'pt';
 664      $args['format']   = 'list';
 665  
 666      return $args;
 667  }
 668  add_filter( 'widget_tag_cloud_args', 'twentyfourteen_widget_tag_cloud_args' );
 669  
 670  
 671  // Implement Custom Header features.
 672  require get_template_directory() . '/inc/custom-header.php';
 673  
 674  // Custom template tags for this theme.
 675  require get_template_directory() . '/inc/template-tags.php';
 676  
 677  // Add Customizer functionality.
 678  require get_template_directory() . '/inc/customizer.php';
 679  
 680  /*
 681   * Add Featured Content functionality.
 682   *
 683   * To overwrite in a plugin, define your own Featured_Content class on or
 684   * before the 'setup_theme' hook.
 685   */
 686  if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
 687      require get_template_directory() . '/inc/featured-content.php';
 688  }
 689  
 690  /**
 691   * Add an `is_customize_preview` function if it is missing.
 692   *
 693   * Enables installing Twenty Fourteen in WordPress versions before 4.0.0 when the
 694   * `is_customize_preview` function was introduced.
 695   */
 696  if ( ! function_exists( 'is_customize_preview' ) ) :
 697  	function is_customize_preview() {
 698          global $wp_customize;
 699  
 700          return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
 701      }
 702  endif;


Generated: Wed Aug 12 01:00:03 2020 Cross-referenced by PHPXref 0.7.1