custom fields driving me mad (6 posts)

  1. kanefulton
    Posted 6 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:


    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:


    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
    Posted 6 years ago #

    You should be able to use get_post_meta.

    Custom Fields

    Some people swear by:

  3. kanefulton
    Posted 6 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
    Posted 6 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
    Posted 6 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
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic