• A quick question here,

    Without using a plugin or recoding php, if you create a “Custom Field”, is there a simple way to get it to ‘Appear’ on the post itself?

    I don’t think so, but I just thought I’d ask.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    You will need to edit your theme’s template files to display the custom fields. Try it with the get_post_meta() function.

    Thread Starter TDP'sGM

    (@gmhilltop)

    Thanks keesiemeijer.

    I am sure it is relatively simple to do, but I am not sure I am ready to tackle PHP just yet.

    I have tinkered just a bit with it, and I have to take more time to wrap my brain around just how to use it.

    HTML and CSS is pretty straight forward compared to PHP. I don’t mind at all getting into the files and changing the code, but I want to make sure that I UNDERSTAND what it is that I am doing too.

    Thanks again for the link though.

    Thread Starter TDP'sGM

    (@gmhilltop)

    keesiemeijer (or anyone else who can help)

    I think that I have finally hit a wall, and I am going to have to learn how to integrate PHP code.

    I am pretty good at just copy and pasting code, (when I at least have a clue what the code is saying an doing). I have gone through some basic PHP syntax, and I sorta get what they are saying.

    Having said that, when I review pages like this:

    codex.www.ads-software.com/Function_Reference/get_post_custom

    I am still lost. Am I to take that code exactly as it is:

    <?php
    
      $custom_fields = get_post_custom(72);
      $my_custom_field = $custom_fields['my_custom_field'];
      foreach ( $my_custom_field as $key => $value )
        echo $key . " => " . $value . "<br />";
    
    ?>

    and whack it into the wp-includes/post.php file?
    (It was a rhetorical question). No, I don’t think so, but I could be wrong.
    And then there is there WHERE in that file am I to put it?
    sure it says

    get_post_custom() is located in wp-includes/post.php

    but that doesn’t really help me much.

    I am willing to read, willing to learn, but this is my biggest problem that I am having with WordPress Codex, and having to tinker with the PHP a little… I don’t really understand EXACTLY where it is that they want me to put the code…I am pretty sure that in the code example above I am not to include the “72” or “my_custom_field” (literally) in the code. They are probably saying that I should include the actual ‘Name’ of my custom field, but there are other instances where that is NOT so obvious to me.

    Is there ANY examples of a video where someone has walked people through the CODEX page AND then executed that information with a real LIVE example?

    Anyone’s help here would be greatly appreciated.
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making Custom Field Visible in post’ is closed to new replies.