telescreen
Member
Posted 4 months ago #
If you go to this post http://revivl.com/features/?p=39 you can see I have the image and link coming in correctly but the title displayed is that of the post I am currently reading. Here is the code i'm using:
<div class="col1">
<h2>Related Posts</h2>
<?php
$results = $wpdb->get_results(yarpp_sql(array('post'),array()));
foreach ( (array) $results as $_post ) : ?>
<div class="th fl">
<a href="<?php echo get_permalink($_post->ID); ?>">
<img src="<?php echo get_post_meta($_post->ID, 'post-img', true); ?>" alt="" /></a>
</div>
<a href="<?php echo get_permalink($_post->ID); ?>" rel="bookmark"><?php echo get_the_title(); ?></a>
<div class="hl2"></div>
<?php endforeach; ?>
</div>
Thanks in advance for your help.
well it show right title
you see some thing like this /?p=70
its b'cose you didn't set up your permalink
you keep as default ,so you find different
btw can you share what kind plugin your using for bands/artist registration ?
telescreen
Member
Posted 4 months ago #
I gave it a try but it didn't work. Only the featured page is wordpress. The artist sign up area is all custom php.
@telescreen - the use of yarpp_sql directly is unsupported. Please use the new templating system built into YARPP 3:
http://mitcho.com/blog/projects/yarpp-3-templates/
Hein35
Member
Posted 2 months ago #
@telescreen
I see you've found the solution for this, please explain me the fix.
jhulott
Member
Posted 1 month ago #
@Hein35 - I had the same problem. If you use the @telescreen code above, the issue is in the line of code here:
<a href="<?php echo get_permalink($_post->ID); ?>" rel="bookmark"><?php echo get_the_title(); ?></a>
You need to change it to:
<a href="<?php echo get_permalink($_post->ID); ?>" rel="bookmark"><?php echo get_the_title($_post->ID); ?></a>
That works for me!