i feel bad, you always seem to have questions no one can answer. i cant really help. the only thing i can think of is your “Show at most:” setting in your reading options. but i really doubt that would over ride your settings.
p.s. i failed your muppet test cause boober wasnt on it π
Hahaha… that’s very nice, thanks! π
I’m glad people are at least LOOKING at my posts. And I think you’re the first person I know who’s failed the Muppet Test! (I should add Boober.)
Hopefully someone will be able to help on this one at least.
Ok here’s a dumb question – but what DO you have as the number in Settings>Reading Blog pages show at most XX posts?
Try this. On a local install I got it to spit out the same 15 images with excerpts while the main page is set to display only 5 posts. You’ll have to play around with it to get the result you want but it should get you started.
<?php query_posts('category_name=test&showposts=15'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Buy this..."><?php post_image('/your/image/path/pic.gif', true); ?></a>
<?php the_excerpt(); ?>
<?php endwhile; ?><?php endif; ?>
TrishaM – never a dumb question, or at least sometimes the dumb questions are the ones I’ve overlooked… however, not in this case. It is set to 10, and I had tried setting it to 99. But thanks!
LenK – That did it! π
Not sure what is different except you’re using “category_name” instead of “cat” and you have the “endwhile” and “endif” instead of the “endforeach”… but I don’t care why it’s working… it’s just working!
Thanks!
Actually to get them to appear on ALL the pages (not just the homepage) I had to use this code:
<?php $posts = query_posts('category_name=sidebar&showposts=-1');
foreach ($posts as $post) : start_wp(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Buy this..."><?php post_image('default_image', 'use_thumb=1'); ?></a>
<?php endforeach; ?>
It was the “query_posts” instead of “get_posts” that did it though.
Thanks again everyone!
And see boober… I get my questions answered now and then. π
Your basic problem is that you didn’t make a proper Loop correctly. Even your later example is incorrect and can cause other issues. I mean, it works, but only as a sort of side effect.
Here’s a corrected example:
<?php query_posts('category_name=sidebar&showposts=-1');
while(have_posts()): the_post(); ?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Buy this..."><?php post_image('default_image', 'use_thumb=1'); ?></a>
<?php endwhile; ?>
However, this will mess with the main Loop and so it’s not a good thing to put in a sidebar. A better example would be this:
<?php $my_query = new WP_Query('category_name=sidebar&showposts=-1');
while($my_query->have_posts()): $my_query->the_post(); ?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Buy this..."><?php post_image('default_image', 'use_thumb=1'); ?></a>
<?php endwhile; ?>
This second one uses a separate query to avoid contaminating the main one.
woohoo noelgreen! im glad the real experts were able to fix it!!