Mycket flitig postare
|
|
Reg.datum: Oct 2010
Inlägg: 709
|
|
Mycket flitig postare
Reg.datum: Oct 2010
Inlägg: 709
|
ja alltså. Index.php innehåller ju inte speciellt mycket kod. Däremot tror jag det är mycket intressantare att veta vad som loop.php innehåller.
INDEX.PHP
<div id="content-wrapper">
<div id="content" role="main">
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div>
LOOP.PHP
<?php /* How to display all other posts. */ ?>
<?php else : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_post_thumbnail(); ?>
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
<?php
$excerpt = get_the_excerpt( __( 'Fortsätt läsa <span class="meta-nav">»</span>', 'twentyten' ));
echo string_limit_words($excerpt,25);
?>
<?php else : ?>
<div class="entry-content">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_content( __( 'Fortsätt läsa <span class="meta-nav">»</span>', 'twentyten' ) ); ?>
</div><!-- .entry-content -->
<?php wp_link_pages( array( 'before' => '' . __( 'Sidor:', 'twentyten' ), 'after' => '' ) ); ?>
<?php endif; ?>
<div class="pub-kat"><?php twentyten_posted_on(); ?>
<?php comments_popup_link( __( '0 kommentarer', 'twentyten' ), __( '1 kommentar', 'twentyten' ), __( '% kommentarer', 'twentyten' ) ); ?>
</div>
<div class="s-kate">
<?php if ( count( get_the_category( ) ) ) : ?>
<?php printf( __( '%2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
<?php endif; ?>
</div>
<div class="clear"></div>
</div>
<?php comments_template( '', true ); ?>
<?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
|