Post before Content
-
On my website I have the content displaying using the code:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <h1 align="center"><?php the_title(); ?></h1> <?php the_content(); ?> <?php endwhile; ?>Then I have my news posts showing below it using the code:
<?php // Include WordPress define('WP_USE_THEMES', false); require('./wp-load.php'); query_posts('showposts=1&cat=18'); ?> <?php if ( have_posts() ): ?> <h1>News Titles</h1> <?php while ( have_posts() ) : the_post(); ?> <h2 style="margin-bottom:10px;"><a href="<?php esc_url( the_permalink() ); ?>" title="Permalink to <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <p align="center"><?php the_post_thumbnail(array(480,480)); ?> </p> <?php the_excerpt(); ?> <div style="float:none;clear:both"></div> <?php endwhile; ?> <?php else: ?> <h2>No posts to display</h2> <?php endif; ?>My goal is to show my news posts on my page before my content so when I put my news posts coding above the content coding, the content coding gets all messed up and the displays my posts.
Is there a way I can have them flip without having my content code show my news posts?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Post before Content’ is closed to new replies.