WordPress.org

Ready to get started?Download WordPress

Forums

custom fields driving me mad (6 posts)

  1. kanefulton
    Member
    Posted 4 years ago #

    Hello. My site is http://www.audioscribbler.co.uk . I'm having a nightmare with custom fields. I just can't get them to work. On every page where there's a post, I have a box called 'More Info', e.g:

    http://www.audioscribbler.co.uk/astv/15694

    In this box, I want to display tracklist information and other information relevant to the post. I've tried the code found on this site:

    http://www.wprecipes.com/wordpress-how-to-get-custom-fields-outside-the-loop

    And I've tried several plugins but can't seem to get any to work. Are custom fields just not going to work outside of the loop with my template? What's the easiest way to go about this? thanks

  2. MichaelH
    Member
    Posted 4 years ago #

    You should be able to use get_post_meta.

    Related:
    Custom Fields

    Some people swear by:
    http://wordpress.org/extend/plugins/get-custom-field-values/

  3. kanefulton
    Member
    Posted 4 years ago #

    Cheers, I'm checking these out now. Having a look at get_post_meta, the code seems to require a specific post id, wheras the info will be pulled from any number of categories.

    I've also actually tried that get-custom-field-values, I thought it looked the easiest. All I've done is copy and paste this code into my custom sidebar:

    ** <?php function c2c_get_recent_custom( $field, $before='', $after='', $none='', $between=', ', $before_last='', $limit=1, $unique=false, $order='DESC', $include_pages=true, $show_pass_post=false ) ?> Template tag for use outside "the loop" and applies for custom fields regardless of post. **

    changing $field with $info , but it's obviously not working. I'm guessing at this point I should probably try posting on the plugins wall to see if anyone can help with it. I was just wondering if anybody had any quick fix solutions.

  4. MichaelH
    Member
    Posted 4 years ago #

    So what are you trying to do?

    I'll guess...

    Display all custom field values that are used in posts that belong to category x

  5. kanefulton
    Member
    Posted 4 years ago #

    Basically, I want writers to be able to choose 'info' as a custom field key, then as value, type in (for example)

    1. song 1
    2. song 2
    3. song 3

    and so on. And then that info will appear in the 'more info' box in the top left.

    edit: just realised I was talking rubbish in my last post, I'm not trying to pull any posts from anywhere, I'm just trying to display information that's typed in.

  6. MichaelH
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic