| | #1 |
| New Warrior Member War Room Member |
I'm working with a magazine style theme (primus) that has a slider that displays posts from a specific category.. I would like to change that to display pages rather than posts.. here's the code : <div id="slider"> <div id="mover"> <?php $glidecat = get_option('zm_gldcat'); $glidecount = get_option('zm_gldct'); $my_query = new WP_Query('category_name= '. $glidecat .'&showposts= '. $glidecount . ''); while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?> <div class="slide"> <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <span class="slmet"> Posted by <?php the_author(); ?> On <?php the_time('F - j - Y'); ?> </span> <p><?php the_excerpt(); ?></p> <?php $gallery = get_post_meta($post->ID, 'gallery', $single = true); ?> <img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $gallery; ?>&h=120&w=250&zc=1" alt=""/> </a> </div> <?php endwhile; ?> </div> </div> I'm sure others would appreciate how to change this from pulling and displaying posts to displaying pages.. would be much more versatile.. Thanks in advance for your time.. |
|
I love what I do and make money every day. It is as easy as 123. If you are interested in finally making money online, and you want to work with an amazing mastermind group that will be with you every step of the way showing you how let me know... Advertising your business doesn't have to take you all day... http://myadposted.com simple amazing customer support and personalized service. | |
| |
| | #2 |
| Technical Warrior War Room Member Join Date: 2007 Location: Malaysia
Posts: 59
Thanks: 5
Thanked 17 Times in 14 Posts
|
Replace this part <?php $glidecat = get_option('zm_gldcat'); $glidecount = get_option('zm_gldct'); $my_query = new WP_Query('category_name= '. $glidecat .'&showposts= '. $glidecount . ''); while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?> with this <?php $glidecount = get_option('zm_gldct'); $my_query = new WP_Query('post_type=page&showposts= '. $glidecount . ''); while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?> and there you go. - Rufas |
| | |
| |
|
| Bookmarks |
| Tags |
| change, display, pages, posts, slider |
| |