Cant show page instead of blog post
-
Hi
I am curently setting up this site
I am trying to replace the top 3 blog boxes to display page posts insted of the blog cats.
The current code is
<?php $my_query = array( 'showposts' => '1', 'cat' => $wp_theme_options['top3_cat_middle'], 'post__not_in' => $ignore ); $my_query = new WP_Query($my_query); ?> <?php if ($my_query->have_posts()) : $my_query->the_post(); ?> <?php $ignore[] = $post->ID; ?> <div class="post"> <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php $thumb_img = portfolio_get_post_image( $post->ID, 'Thumbnail', 278, 100 ); ?> <?php if ( ! empty( $thumb_img ) ) : ?> <img src="<?php echo $thumb_img; ?>" /> <?php endif; ?> <p><?php the_excerpt_rss(); ?></p> </div>
I have tried to change the code to
<?php query_posts( 'page=2' ); ?> <?php $ignore[] = $post->ID; ?> <div class="post"> <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php $thumb_img = portfolio_get_post_image( $post->ID, 'Thumbnail', 278, 100 ); ?> <?php if ( ! empty( $thumb_img ) ) : ?> <img src="<?php echo $thumb_img; ?>" /> <?php endif; ?> <p><?php the_excerpt_rss(); ?></p> </div>
As well as
<?php query_posts('post_type=page&post_status&page_id=2'); ?> <?php $ignore[] = $post->ID; ?> <div class="post"> <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php $thumb_img = portfolio_get_post_image( $post->ID, 'Thumbnail', 278, 100 ); ?> <?php if ( ! empty( $thumb_img ) ) : ?> <img src="<?php echo $thumb_img; ?>" /> <?php endif; ?> <p><?php the_excerpt_rss(); ?></p> </div>
But it just seems to ignore this and displays a random blog cat.
Am I missing something?
Thanks for any help in advance!
- The topic ‘Cant show page instead of blog post’ is closed to new replies.