Forums

using &tag=$tagname (1 post)

  1. tara_irvine
    Member
    Posted 1 year ago #

    I've made this site and the user can add as many tags as they want, but I also have a custom-field relating to each tag.

    I really need
    $tagname = the_tags('');
    $lastposts = get_posts('numberposts=100&tag=$tagname');?>
    <?php foreach($lastposts as $post) : setup_postdata($post);?>
    <?php $project_info = get_post_meta($post->ID,'project_info', true); ?>
    <?php if($project_info !=""){ ?>
    <p><?php echo $project_info; ?></p>
    <?php } else { echo ''; } ?>
    <?php endforeach; ?>

    it works well if the $lastposts = get_posts('numberposts=100&tag=$tagname');?> is $lastposts = get_posts('numberposts=100&tag=('TAGNAME');?>

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags