Forums

Help me understand Custom Fields (9 posts)

  1. Dgold
    Member
    Posted 6 years ago #

    I have been studying about Custom Fields and I still don't get it, at least one basic thing I'm confused.

    It seems like everyone uses custom fields to display 1 piece of "current data" in your sidebar, so I'm assuming it takes the custom field like Mood:Happy! from your most recent post. But can I display the unique custom value in EACH post on my homepage? Example, Mood at the time of this post was:Happy! and there are 10 posts showing on that page each with its own answer?

    Also, can I just use Custom Fields anyway (is there a PHP call for it) or do I actually need this plugin? http://www.coffee2code.com/archives/2004/06/30/plugin-get-custom/#examples

  2. moshu
    Member
    Posted 6 years ago #

    I hope you saw this: Using_Custom_Fields
    And yes, actually you can have a different "mood" for each post :)

  3. Dgold
    Member
    Posted 6 years ago #

    Yes I have read the Codex page about it 5 times. It doesn't answer my first question, nor give any examples like that. As far as I can tell.

    To tell you the truth the Codex page really doesn't show a novice how Custom plugins work. I would like illustration, link to working examples, not just the concept. The only examples they use are Current Mood: and Currently Reading:.

    Really, I was just hoping someone could answer "yes" or "no" on my 2 questions.

  4. moshu
    Member
    Posted 6 years ago #

    If by "second question" you mean
    Also, can I just use Custom Fields anyway (is there a PHP call for it) or do I actually need this plugin?
    then you have to read that article the 6th times :) LOL

    2. Displaying custom fields:
    <?php the_meta(); ?>
    that's all you need to place into your template (e.g. index.php) wher you want it displayed and ... the rest is explained also there.

  5. Dgold
    Member
    Posted 6 years ago #

    alright thanks for trying to help, I guess I am just confused. I guess I will just make some custom fields and put values in, and put the_meta in a post and see what happens. Usually I like to try to understand it first but this is just not clear to me what it's going to do, when I have multiple fields and/or when I have multiple posts. I will experiment.

    Maybe if I say more like what I want, instead of the Mood example.

    I have a blog where every post is a song. I want every post to have fields under it: Best version of this song. Albums this song is on. Bands who cover this song. So I want it with each post (each song) not in the sidebar showing just the latest.

  6. puremood
    Member
    Posted 6 years ago #

    I'll try to help.

    Yes, you can I display a unique one in EACH post.

    Under the post you will add the key "bands" (or whatever you want it to read) and in the value you'd put the bands who cover the song... then click to add.

    Then if you want to add another one for the same post you just repeat the steps above to add the new key and value.

    You only need to add a key once, after that it's saved and each time you need to use a previously created key just select it from the pull down menu.

    Once you've got them all set up, make sure you call them using the meta tag in your index.php where you want it to appear.

    I did this on my site if you'd like to see. If you have any other questions - I'll do my best to help.

  7. moshu
    Member
    Posted 6 years ago #

    Best version of this song:
    Albums this song is on:
    Bands who cover this song:

    Those would be fields - and whatever comes after the colon would be the value. The same field can have different values for each post.

  8. Dgold
    Member
    Posted 6 years ago #

    thanks everyone I am working on it & going for another study of the codex

  9. Dgold
    Member
    Posted 6 years ago #

    Wow. This plugin made all-the-difference in the world.

    http://rhymedcode.net/projects/custom-field-gui/

    I recommend this to anyone who is new at using Custom Fields, this helped me visualize what to use Custom Fields for, and now it is a great feature on one of my blogs.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags