Page template problems
-
So Im creating a custom site that uses WordPress as a CMS. But I have just one issue. after I do a query in top of the page to spit out latest stories I also spit out the query in my if have post loop.
<div id="slider"> <ul> <?php query_posts('cat=3'); ?> <?php while (have_posts()) : the_post();?> <li> <h1>Latest News</h1> <h3><a href='<?php the_permalink(); ?>'><?php the_title(); ?></a></h3><br/> <p><a href='<?php the_permalink(); ?>'><?php the_excerpt(); ?><br/></a></p> </li<?php endwhile; ?> </ul></div>
So that code works perfectly as it should problem is I want the loop not to run when I want information from my current page to display in the body and not the loop
<div class="span-14 append-1 last" id="body-content"> <?php getFirst_ID(); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( is_front_page() ) { ?> <h2 class="entry-title"><?php the_title(); ?></h2> <?php } else { ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php } ?> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-content --> </div><!-- #post-## --> <?php endwhile; ?>
That is what is in the body so here is the link to the site
Pamelaruizassociates.com That way you can see the issue first hand.
If you are able to help thank you very much Do note I cannot just call a page number to pull content from because this is the template for all pages and since the client is not a programmer I don’t expect them to come in and create custom pages.
- The topic ‘Page template problems’ is closed to new replies.