Support » Fixing WordPress » adding an if statement to twenty ten loop.php

  • Resolved csleh


    I’m trying to edit the twenty ten theme loop.php. On my old theme I had a few if/else statements but for the life of me I cannot get it to work here.

    Trying to add this code in between the if is_archive and everything else, but it breaks the loop on category page (not category 8, interestingly enough)

    ‘<?php (is_page(‘newsletterthanks’)) : ?>
    <?php query_posts(‘cat=8&showposts=100’); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h2>“><?php the_title(); ?> »</h2><p><?php the_excerpt(); ?></p>
    <?php endwhile; ?>’

    this is the twenty ten code bit:
    ‘<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    <div class=”entry-summary”><?php the_excerpt(); ?></div><!– .entry-summary –>
    <?php else : ?>
    <div class=”entry-content”><?php the_content( ); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘twentyten’ ), ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>
    <?php endif; ?>’

Viewing 2 replies - 1 through 2 (of 2 total)
  • Answered my own question. Added simple if/else to the PAGE.php template and it’s working perfectly.

    hey…. I want to know how is your if/else code that you enter in page.php
    because I want to order my comments for category but I have no idea how to do it or how to search this… Thx a lot…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding an if statement to twenty ten loop.php’ is closed to new replies.