Here’s my code.
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts = query_posts('category_name=portfolio&showposts=6&paged=$page');
foreach ($posts as $post) : start_wp();
?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="view details..."><?php post_image('default_image', 'use_thumb=1'); ?></a>
<?php endforeach; ?>
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
The previous and next buttons aren’t working on my pages.
Do you mean Pages? It is not supposed to work on them.
Is it about the blog linked to your profile?
Yes, I mean pages… and no, it’s this site.
Hmm… Okay, I sorta see what you’re doing there.. I don’t much like your loop though. It’s weird.
Try something more like this:
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('category_name=portfolio&showposts=6&paged=$page');
while (have_posts()) : the_post();
?>
... blah ...
<?php endwhile; ?>
Ahhh… I see that blue-underwater icon and KNOW there is hope! 🙂
Tried that, and now it doesn’t show the posts either.
Actually, it’s showing the post links fine, just not the images. Look at the source:
...
<a href="http://www.parkeastinc.com/2.0/portfolio/couponfridgecom.php" rel="bookmark" title="view details..."></a>
<a href="http://www.parkeastinc.com/2.0/portfolio/east-grand-church-of-christ.php" rel="bookmark" title="view details..."></a>
...
So that post image thing is having some sort of issue with the new stuff. What plugin is that?
Also, the paging seems to work fine on your normal category pages…
http://www.parkeastinc.com/2.0/category/portfolio/page/2
It’s the “post image” plug-in. It allows me to show the 1st image uploaded in a post, without showing the actual post content.
Okay, I looked at the post image source. Seems a bit complex to me, might not work with 2.5 properly in all cases.
You could try something like this instead:
$attachments = get_children(array(
'post_parent'=>$post->ID,
'post_type'=>'attachment',
'post_mime_type'=>'image',
'orderby'=>'menu_order ASC, ID ASC',
));
foreach ( $attachments as $att_id => $attachment ) {
echo wp_get_attachment_image($att_id, 'medium');
break;
}
That’s just off-the-cuff code, might not work.
Haha… well, that got the image to display… but the pagination doesn’t work again. (and the styling is screwy… but I could fix that) I put that code in place of the
post_image('default_image', 'use_thumb=1');
Correct?
Maybe there’s another way to display just the image from that post and not the post’s content?
Got it… this works:
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("cat=1&showposts=6&orderby=title&order=ASC&paged=$page");
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="view details...">
<?php
$attachments = get_children("post_parent={$post->ID}&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC");
foreach ( $attachments as $att_id => $attachment ) {
echo wp_get_attachment_image($att_id, 'medium');
break;
}
?>
</a>
<?php endwhile; ?>
<?php endif; ?>
Now I need to fix the styling.
Thanks again Otto42!!