Support » Plugins and Hacks » [Plugin: Yet Another Related Posts Plugin] related_posts() vs. get_related_posts()

  • Hi,

    I’m trying to combine this plug-in with the YAPB (Yet Another Photo Blog)-plugin, so that I can show related photos to each single photo.

    To retrieve this I need a way to get the post-objects instead of the outputted xhtml – Something like get_related_posts(). Is this possible?


Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi @bukselak – while this is possible using some custom PHP (see the documentation), it will be *much* easier to do this in the upcoming revision of YARPP which will implement a templating system to let power users uber-customize the way related posts are displayed. For example, you’ll be able to display “related thumnail photos”, for example, if that’s what you want. Stay tuned.

    That’s good news. I’m really looking forward to that 🙂 Thanks for a great plugin so far. Do you have a release date allready?

    @bukselak – I just released a beta of the next revision (3.0 beta 1) and even wrote a tutorial on the new theming feature, including a section on how to work with YAPB. I hope that helps!

    Wohoo! You’re my new best friend!

    @bukselak – Glad to hear. Please let me know how that YAPB template works for you, or if I can make it better. 🙂

    I did a fast, rough implementation at my blog and everything seams to be working properly:) It’s in danish though…

    @bukselak – wow, that looks great! I’m so glad that’s working out for you.

    @bukselak, can I post a link to your blog as an example of this YAPB functionality on that templating article of mine? Better yet, can you leave a comment on my blog ( with a link to your blog? I think it’ll be helpful for others to see the possibilities. Thanks!

    Done 😉

    Buk, is it possible for you to post a copy of the .php file you modified for the photo to show? the file attached with 3.0 beta dosnt work for me to display the thumbnail. thanks.

    @fjiorea – Sure 🙂

    <?php if ($related_query->have_posts()):?>
    	<ol class="related">
    	<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
    		<?php if (function_exists('yapb_is_photoblog_post')): if (yapb_is_photoblog_post()):?>
    				<?php if ($post->image): ?>
                        <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent link to <?php the_title(); ?>">
                            <img src="<?php echo $post->image->getThumbnailHref(array('q=95','wl=65','hp=65')) ?>" alt="<?php the_title() ?>" title="<?php the_title() ?>" />
                    <?php endif ?>
    		<?php endif; endif; ?>
    	<?php endwhile; ?>
    <?php else: ?>
    <?php endif; ?>

    Hope it workes out for you 🙂

    @fjiorea – what problems were you having with the code bundled in the beta? Was that from the latest beta? (beta 4)




    I’ve been using your YAARP plugin on my blog for a while now. Gotta say, this is the best related posts plugin I’ve tested so far.

    I have one question.

    I have the YAARP widget on one of my sidebars. This particular sidebar is not really wide (160px). I’ve been trying to figure out a way of getting the [b]stars[/b] for each post to show up in a new line right under the post title, but for the life of me I have not been able to accomplish this.
    Can you point me in the right direction?

    Sebastian, I’m not exactly sure what you’re looking to do, but by your description this seems to be a CSS issue. Maybe adding some HTML classes and changing those CSS directives will do the trick? I hope so. 🙂

    Otherwise, if you need more control, YARPP 3 will introduce the templating feature described in this thread and also here:

    I just submitted a new plug-in for people who need thumbnails with their related posts… have a look. it is good SEO wise and you can customize it at will.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: Yet Another Related Posts Plugin] related_posts() vs. get_related_posts()’ is closed to new replies.