Forums

Echo post meta on archive page? (6 posts)

  1. clinton4
    Member
    Posted 1 year ago #

    Hi,

    Is it not possible to display post meta data in a archive (category.php) page?

    I have tried:

    <?php echo get_post_meta($post->ID, 'custom-name', true); ?>

    But nothing is displaying.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Are you inside or outside the Loop?

  3. clinton4
    Member
    Posted 1 year ago #

    Inside the loop.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try:

    ,?php echo '<pre>';
    print_r( get_post_meta($post->ID, 'custom-name', true) );
    echo '</pre>';
    ?>
  5. clinton4
    Member
    Posted 1 year ago #

    I get nothing. And i'am 100% sure i use the correct custom-name and that there is data in it. It is working fine on the post page.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Perhaps something in your archive.php's Loop is causing a problem?

Topic Closed

This topic has been closed to new replies.

About this Topic