Make WordPress Core


Ignore:
Timestamp:
10/29/2013 07:05:02 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: allow any page to be set as the front page, removing requirement for front-page.php template file. Props iamtakashi, fixes #25685.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/image.php

    r25769 r25985  
    1313?>
    1414
    15 <section id="primary" class="content-area image-attachment">
    16     <div id="content" class="site-content" role="main">
     15<div id="main-content" class="main-content">
     16    <section id="primary" class="content-area image-attachment">
     17        <div id="content" class="site-content" role="main">
    1718
    18     <?php while ( have_posts() ) : the_post(); ?>
     19        <?php while ( have_posts() ) : the_post(); ?>
    1920
    20         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    21             <header class="entry-header">
    22                 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
     21            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     22                <header class="entry-header">
     23                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    2324
    24                 <div class="entry-meta">
     25                    <div class="entry-meta">
    2526
    26                     <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
     27                        <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
    2728
    28                     <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
     29                        <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
    2930
    30                     <span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
    31                     <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
    32                 </div><!-- .entry-meta -->
    33             </header><!-- .entry-header -->
     31                        <span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
     32                        <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
     33                    </div><!-- .entry-meta -->
     34                </header><!-- .entry-header -->
    3435
    35             <div class="entry-content">
    36                 <div class="entry-attachment">
    37                     <div class="attachment">
    38                         <?php twentyfourteen_the_attached_image(); ?>
    39                     </div><!-- .attachment -->
     36                <div class="entry-content">
     37                    <div class="entry-attachment">
     38                        <div class="attachment">
     39                            <?php twentyfourteen_the_attached_image(); ?>
     40                        </div><!-- .attachment -->
    4041
    41                     <?php if ( has_excerpt() ) : ?>
    42                     <div class="entry-caption">
    43                         <?php the_excerpt(); ?>
    44                     </div><!-- .entry-caption -->
    45                     <?php endif; ?>
    46                 </div><!-- .entry-attachment -->
     42                        <?php if ( has_excerpt() ) : ?>
     43                        <div class="entry-caption">
     44                            <?php the_excerpt(); ?>
     45                        </div><!-- .entry-caption -->
     46                        <?php endif; ?>
     47                    </div><!-- .entry-attachment -->
    4748
    48                 <?php
    49                     the_content();
    50                     wp_link_pages( array(
    51                         'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    52                         'after'       => '</div>',
    53                         'link_before' => '<span>',
    54                         'link_after'  => '</span>',
    55                     ) );
    56                 ?>
    57             </div><!-- .entry-content -->
     49                    <?php
     50                        the_content();
     51                        wp_link_pages( array(
     52                            'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
     53                            'after'       => '</div>',
     54                            'link_before' => '<span>',
     55                            'link_after'  => '</span>',
     56                        ) );
     57                    ?>
     58                </div><!-- .entry-content -->
    5859
    59             <footer class="entry-meta">
    60                 <?php
    61                     if ( comments_open() && pings_open() ) : // Comments and trackbacks open
    62                         printf( __( '<a class="comment-link" href="#respond">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
    63                     elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
    64                         printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
    65                     elseif ( comments_open() && ! pings_open() ) : // Only comments open
    66                         _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond">post a comment</a>.', 'twentyfourteen' );
    67                     elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
    68                         _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' );
    69                     endif;
    70                 ?>
    71             </footer><!-- .entry-meta -->
    72         </article><!-- #post-## -->
     60                <footer class="entry-meta">
     61                    <?php
     62                        if ( comments_open() && pings_open() ) : // Comments and trackbacks open
     63                            printf( __( '<a class="comment-link" href="#respond">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     64                        elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
     65                            printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     66                        elseif ( comments_open() && ! pings_open() ) : // Only comments open
     67                            _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond">post a comment</a>.', 'twentyfourteen' );
     68                        elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
     69                            _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' );
     70                        endif;
     71                    ?>
     72                </footer><!-- .entry-meta -->
     73            </article><!-- #post-## -->
    7374
    74         <nav id="image-navigation" class="navigation image-navigation">
    75             <div class="nav-links">
    76             <?php previous_image_link( false, __( '<div class="previous-image">Previous Image</div>', 'twentyfourteen' ) ); ?>
    77             <?php next_image_link( false, __( '<div class="next-image">Next Image</div>', 'twentyfourteen' ) ); ?>
    78             </div><!-- .nav-links -->
    79         </nav><!-- #image-navigation -->
     75            <nav id="image-navigation" class="navigation image-navigation">
     76                <div class="nav-links">
     77                <?php previous_image_link( false, __( '<div class="previous-image">Previous Image</div>', 'twentyfourteen' ) ); ?>
     78                <?php next_image_link( false, __( '<div class="next-image">Next Image</div>', 'twentyfourteen' ) ); ?>
     79                </div><!-- .nav-links -->
     80            </nav><!-- #image-navigation -->
    8081
    81         <?php comments_template(); ?>
     82            <?php comments_template(); ?>
    8283
    83     <?php endwhile; // end of the loop. ?>
     84        <?php endwhile; // end of the loop. ?>
    8485
    85     </div><!-- #content -->
    86 </section><!-- #primary -->
     86        </div><!-- #content -->
     87    </section><!-- #primary -->
     88</div><!-- #main-content -->
    8789
    8890<?php
Note: See TracChangeset for help on using the changeset viewer.