WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
custom field on category page (3 posts)

  1. panuma
    Member
    Posted 1 year ago #

    Hi,

    This is the php code I use to get my custom field on category page:

    <p><?php the_field('author', 'category_4'); ?></p>

    But this displays the value of category_ID_4 on all my categories.

    How should I do to display the value of each corresponding category_ID ?

    Many thanks in advance!

    http://docstories.net/category/stories/ (cat_ID 2)
    http://docstories.net/category/matteo-gariglio/ (cat_ID 4)

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. panuma
    Member
    Posted 1 year ago #

    any idea?

  3. Sleneau
    Member
    Posted 1 year ago #

    Wouldn't you still just use <?php echo get_post_meta($post->ID,'author',true);?>?

    Are you trying to echo out a specific custom field for each post in a loop, or the name of the author?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.