fotofio
Member
Posted 9 months ago #
I am having dificulty on one project with the following code. The end result is the proper excerpt and read more links but the title for each of the two posts comes from yet another post in another category.
Who can figure this one out?
<div class="sidebar_box2" id="articlesTab"> <div class="mores"><p><a href="<?php next_post_link('%link', '', TRUE); ?>">More »</a></p></div>
<ul>
<?php query_posts('category_name=fp&showposts=2'); //$do_not_duplicate = $post->ID;
if (have_posts()) : while (have_posts()) : the_post();
//if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts);
?>
<li>
<a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a>
<p class="text"><?php the_excerpt(); ?></p>
</li>
<?php endwhile; endif; ?>
</div>
fotofio
Member
Posted 9 months ago #
<div class="sidebar_box2" id="articlesTab"> <div class="mores"><p><a href="<?php next_post_link('%link', '', TRUE); ?>">More »</a></p></div>
<ul>
<?php query_posts('category_name=fp&showposts=2'); //$do_not_duplicate = $post->ID;
if (have_posts()) : while (have_posts()) : the_post();
//if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts);
?>
<li>
<a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"><?php echo $title ?></a>
<p class="text"><?php the_excerpt(); ?></p>
</li>
<?php endwhile; endif; ?>
</div>
change $title to $post->post_title
fotofio
Member
Posted 9 months ago #
Thanks buddy, that got it done. The permakink is a little funky, seems to point to a revision? Any guidance there?
I would look into changing
get_permalink($postid) to get_permalink($post->ID)