~ubuntu-branches/debian/jessie/wordpress/jessie

« back to all changes in this revision

Viewing changes to wp-content/themes/twentyfourteen/functions.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2014-04-17 20:56:19 UTC
  • mfrom: (1.2.35)
  • Revision ID: package-import@ubuntu.com-20140417205619-nurbet6eho4yvwfv
Tags: 3.9+dfsg-1
* New upstream release
* 3.9 seems to handle different locations for plugins so the
  plugin directory handling patches have been cut back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
         * to output valid HTML5.
90
90
         */
91
91
        add_theme_support( 'html5', array(
92
 
                'search-form', 'comment-form', 'comment-list',
 
92
                'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
93
93
        ) );
94
94
 
95
95
        /*
121
121
 * Adjust content_width value for image attachment template.
122
122
 *
123
123
 * @since Twenty Fourteen 1.0
124
 
 *
125
 
 * @return void
126
124
 */
127
125
function twentyfourteen_content_width() {
128
126
        if ( is_attachment() && wp_attachment_is_image() ) {
164
162
 * Register three Twenty Fourteen widget areas.
165
163
 *
166
164
 * @since Twenty Fourteen 1.0
167
 
 *
168
 
 * @return void
169
165
 */
170
166
function twentyfourteen_widgets_init() {
171
167
        require get_template_directory() . '/inc/widgets.php';
225
221
 * Enqueue scripts and styles for the front end.
226
222
 *
227
223
 * @since Twenty Fourteen 1.0
228
 
 *
229
 
 * @return void
230
224
 */
231
225
function twentyfourteen_scripts() {
232
226
        // Add Lato font, used in the main stylesheet.
262
256
                ) );
263
257
        }
264
258
 
265
 
        wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131209', true );
 
259
        wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true );
266
260
}
267
261
add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
268
262
 
270
264
 * Enqueue Google fonts style to admin screen for custom header display.
271
265
 *
272
266
 * @since Twenty Fourteen 1.0
273
 
 *
274
 
 * @return void
275
267
 */
276
268
function twentyfourteen_admin_fonts() {
277
269
        wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
283
275
 * Print the attached image with a link to the next attached image.
284
276
 *
285
277
 * @since Twenty Fourteen 1.0
286
 
 *
287
 
 * @return void
288
278
 */
289
279
function twentyfourteen_the_attached_image() {
290
280
        $post                = get_post();
352
342
 * Print a list of all site contributors who published at least one post.
353
343
 *
354
344
 * @since Twenty Fourteen 1.0
355
 
 *
356
 
 * @return void
357
345
 */
358
346
function twentyfourteen_list_authors() {
359
347
        $contributor_ids = get_users( array(
380
368
                                <p class="contributor-bio">
381
369
                                        <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
382
370
                                </p>
383
 
                                <a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
 
371
                                <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
384
372
                                        <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
385
373
                                </a>
386
374
                        </div><!-- .contributor-summary -->
461
449
 * @return array The filtered post class list.
462
450
 */
463
451
function twentyfourteen_post_classes( $classes ) {
464
 
        if ( ! post_password_required() && has_post_thumbnail() ) {
 
452
        if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) {
465
453
                $classes[] = 'has-post-thumbnail';
466
454
        }
467
455
 
487
475
        }
488
476
 
489
477
        // Add the site name.
490
 
        $title .= get_bloginfo( 'name' );
 
478
        $title .= get_bloginfo( 'name', 'display' );
491
479
 
492
480
        // Add the site description for the home/front page.
493
481
        $site_description = get_bloginfo( 'description', 'display' );