WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding an if statement to twenty ten loop.php (3 posts)

  1. csleh
    Member
    Posted 3 years ago #

    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; ?>'

  2. csleh
    Member
    Posted 3 years ago #

    Answered my own question. Added simple if/else to the PAGE.php template and it's working perfectly.

  3. harumyherrera
    Member
    Posted 3 years ago #

    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...

Topic Closed

This topic has been closed to new replies.

About this Topic