have_posts() have_page()?

I’m working on a school project and am trying to alter the code so that instead of new posts showing up in a slide image in the header of the theme, it will display pages. Is there a easy way to do this. Is have_page() a way to call pages instead of posts? The code looks like this:


<div id="slidearea">
<?php
	$gldcat =get_option('evandr_gldcat');
	$gldct = get_option('evandr_gldct');
?>
<div id="gallerycover">
<div class="mygallery">
<ul>
<?php
	$my_query = new WP_Query('category_name='.$gldcat.'&showposts='.$gldct.'');
	while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
?>
    <li>
		<a href="<?php the_permalink() ?>">	<?php evandr_slide_image(); ?> </a>
	</li>
	<?php endwhile; ?>
</ul>
<div class="clear"></div>
</div>
</div>
   <a href="#" class="prevb"><img src="<?php bloginfo('template_directory'); ?>/images/prev.png" alt="Previous" /></a>
   <a href="#" class="nextb"><img src="<?php bloginfo('template_directory'); ?>/images/next.png" alt="Next" /></a>

<div id="textcover">
<div class="mytext">

<ul>
<?php
$my_query = new WP_Query('category_name='.$gldcat.'&showposts='.$gldct.'');
while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
?>
    <li>
			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
			<p>  <?php the_content_rss('', TRUE, '', 50); ?> </p>

	</li>
	<?php endwhile; ?>
</ul>
<div class="clear"></div>
</div>
</div>
</div>

I want it to display pages, not posts and link to the pages. The theme I’m using is called Evander (Evander | web2feel.com - Free wordpress themes - Tutorials - Tips and tricks)

What I have done so far is live at JA-CF

You need to modify this:


new WP_Query('category_name='.$gldcat.'&showposts='.$gldct.'');

To get pages. You can just add something like “&post_type=page”.

In Wordpress, everything is either a post (post, pages, menu items, etc) or a taxonomy (tags, categories, etc). So, even if you’re using “have_posts”, it still may be a page… it’s all about what is in the query.

Hi i have the same problem. I want to feature pages images in the slide instead of post in the home page. I tryied to do what you syggest but the only thing hthat change is that the slider doesn’t show anything more.
Any suggestion?
What i have to change in this code?

$my_query = new WP_Query(‘category_name=’.$gldcat.‘&showposts=’.$gldct.‘’);
while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;

I want to check and get all pages like post

$query->have_posts()
$query->the_post()