Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ali Dark

    (@ali-dark)

    Thanks to Paul Robinson of return-true.com who helped me work out the following working code. It turns out the variables were not properly defined.

    <?php
    $catslug = get_post_meta($post->ID, 'catslug', TRUE);
    $cat = get_post_meta($post->ID, catslug, TRUE); ?>

    <?php query_posts( 'category_name=' . $cat ); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h3><?php the_title(); ?></h3>
    <?php endwhile;?>

    Thread Starter Ali Dark

    (@ali-dark)

    By the way, I should mention that I know the loops working as it should – if I replace
    <?php query_posts('category_name=' . $cat ); ?>
    with
    <?php query_posts('category_name=mtgravatt' ); ?>
    It outputs the titles of posts in the category it should.

Viewing 2 replies - 1 through 2 (of 2 total)