Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a reason why psdtv_id isn't being shown in the code below? The output is blank.

    <?php get_header();?>

        <section id="content">

            <h2><?php the_title(); ?></h2>

            <?php
                if (have_posts()) : while (have_posts()) : the_post();

                $custom = get_post_custom($post->ID);
                $psdtv_id = $custom["psdtv_id"][0];
            ?>
            <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
                <? $psdtv_id ?>
            </article>

            <?php endwhile; else: ?>

            <p>Sorry, no posts matched your criteria.</p>

            <?php endif; ?>

        </section>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
share|improve this question
1  
You aren't echoing the value. Try <?=$psdtv_id ?> or <?php echo $psdtv_id ?> but the question is pure PHP and is off topic for this forum per the faq – s_ha_dum Jan 14 at 5:19
Sorry for posting in the wrong forum. I thought there was a problem with the custom fields. Thank you for your help, though! :) – Desi Jan 14 at 5:21
I see this rather as a minor oversight and close it as too localized. :) Note you should never use just <?, that can be turned off. Always use <?php. – toscho Jan 14 at 5:35

closed as too localized by s_ha_dum, toscho Jan 14 at 5:34

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.