Recent Posts & Image plugin or script (help needed!)
-
Hi Everyone
I’ve been hacking away at this issue for a while now, and I just can’t get the solution.
I want a ‘Recent Posts’ script that works in combination with the guff Post Image plugin. I’ve tried using the code below, but each ‘recent post’ only seems to show its’ relevant image (as specified by the Post Image plugin) when the same post is shown within the Loop on the same page;
<ul> <li><h3>Recent Posts</h3></li> <?php $postslist = get_posts('numberposts=3&offset=1&order=DESC&orderby=post_date'); foreach ($postslist as $post) { ?> <ul><li class="recent_post" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>"><img class="postimage" src="<?php post_image('shared/images/post/post_default.jpg', false, false); ?>" width="48" height="48" /></a></a><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3><p class="meta"><?php the_time('F'); ?> <?php the_time('jS Y'); ?> under <?php the_category(' & ') ?> <?php edit_post_link(); ?> </li></ul> <?php }; ?> </ul>
So, that means that unless a post is pulled up within the Loop on the same page, the same post, when shown in the ‘Recent Posts’ script, won’t show its’ own image – it will just show the default Post Image icon which I have specified.
Obviously there is some kind of attribute that is unique to each post and is pulled-up when a post is called within the Loop. The ‘Recent Posts’ script (shown above) doesn’t seem to call this attribute (whatever that may be) – so I’m under the impression that this Recent Posts script isn’t a ‘ proper Loop’ as such.
I’ve also tried calling the Loop, as suggested by the moderator further down in the this thread, https://www.ads-software.com/support/topic/63004?replies=8, but I can’t get the loop to work within the provided imgposts script – it won’t display anything.
Is there a way of calling the Loop, so that it only shows the last 3 posts, with an offset of 1, and so that it formats the posts in a similar way to the script I’ve posted above (inc. the post image) ?
Any help is very much appreciated! I’m going crazy over this one!
- The topic ‘Recent Posts & Image plugin or script (help needed!)’ is closed to new replies.