give $post_id a value
-
Hi I am currently using this:
<ul><?php $recent = new WP_Query("cat=1&showposts=5"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php $key="jeu"; echo get_post_meta($post_id, $key, true); ?></li> <?php endwhile; ?>
If i replace $post_id by a number it works. But I want to be able to add the post ID in $post_id automaticly so I donth ave to do it manualy. I’ve tried $post_id=the_id(); but that doesnt work it only shows the ID instead of getting the value of my custom field.
any help would be great, thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘give $post_id a value’ is closed to new replies.