X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/53f4633144ed68c8b8fb5861f992b5489894a940..febc815b2c9d85be5717da9e8d164bd2daa97e31:/wp-content/themes/twentyfourteen/functions.php diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index 4e65214a..f85ef1ca 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -60,12 +60,12 @@ function twentyfourteen_setup() { /* * Make Twenty Fourteen available for translation. * - * Translations can be added to the /languages/ directory. + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen * If you're building a theme based on Twenty Fourteen, use a find and * replace to change 'twentyfourteen' to the name of your theme in all * template files. */ - load_theme_textdomain( 'twentyfourteen', get_template_directory() . '/languages' ); + load_theme_textdomain( 'twentyfourteen' ); // This theme styles the visual editor to resemble the theme style. add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); @@ -113,6 +113,9 @@ function twentyfourteen_setup() { // This theme uses its own gallery styles. add_filter( 'use_default_gallery_style', '__return_false' ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); } endif; // twentyfourteen_setup add_action( 'after_setup_theme', 'twentyfourteen_setup' ); @@ -316,9 +319,9 @@ function twentyfourteen_the_attached_image() { // If there is more than 1 attachment in a gallery... if ( count( $attachment_ids ) > 1 ) { - foreach ( $attachment_ids as $attachment_id ) { + foreach ( $attachment_ids as $idx => $attachment_id ) { if ( $attachment_id == $post->ID ) { - $next_id = current( $attachment_ids ); + $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; break; } }